|
NetSurf
|
#include <gtk/gtk.h>#include <stdbool.h>#include <stdlib.h>#include <string.h>#include "utils/utils.h"#include "utils/log.h"#include "utils/messages.h"#include "utils/nsurl.h"#include "utils/nsoption.h"#include "netsurf/browser_window.h"#include "desktop/browser_history.h"#include "desktop/hotlist.h"#include "gtk/compat.h"#include "gtk/toolbar_items.h"#include "gtk/menu.h"#include "gtk/local_history.h"#include "gtk/gui.h"#include "gtk/download.h"#include "gtk/window.h"#include "gtk/warn.h"#include "gtk/tabs.h"#include "gtk/resources.h"#include "gtk/scaffolding.h"Go to the source code of this file.
Data Structures | |
| struct | nsgtk_menu |
| menu entry context More... | |
| struct | nsgtk_scaffolding |
| Core scaffolding structure. More... | |
Macros | |
| #define | TOOLBAR_ITEM_p(identifier, name) |
| handle menu activate signals by calling toolbar item activation More... | |
| #define | TOOLBAR_ITEM_y(identifier, name) |
| #define | TOOLBAR_ITEM_n(identifier, name) |
| #define | TOOLBAR_ITEM(identifier, name, sensitivity, clicked, activate, label, iconame) TOOLBAR_ITEM_ ## activate(identifier, name) |
| #define | TOOLBAR_ITEM_p(identifier, name, iconame) |
| handle menu activate signals by calling toolbar item activation More... | |
| #define | TOOLBAR_ITEM_y(identifier, name, iconame) |
| #define | TOOLBAR_ITEM_n(identifier, name, iconame) |
| #define | TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate, label, iconame) |
| #define | ITEM_MB(p, q, r) |
| #define | ITEM_MBP(p, q, r) |
| #define | ITEM_MBp(p, q, r) |
| #define | SENSITIVITY(q) |
Functions | |
| static void | popup_menu_hide (struct nsgtk_popup_menu *menu, bool nav, bool cnp) |
| Helper to hide popup menu entries by grouping. More... | |
| static void | popup_menu_show (struct nsgtk_popup_menu *menu, bool nav, bool cnp) |
| Helper to show popup menu entries by grouping. More... | |
| static void | scaffolding_window_destroy (GtkWidget *widget, gpointer data) |
| resource cleanup function for window destruction. More... | |
| static gboolean | scaffolding_window_delete_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
| gtk event callback on window delete event. More... | |
| static void | scaffolding_update_context (struct nsgtk_scaffolding *g) |
| Update the scaffolding controls. More... | |
| static guint | nsgtk_scaffolding_update_edit_actions_sensitivity (struct nsgtk_scaffolding *g) |
| edit the sensitivity of focused widget More... | |
| static void | nsgtk_scaffolding_enable_edit_actions_sensitivity (struct nsgtk_scaffolding *g) |
| make edit actions sensitive More... | |
| static gboolean | nsgtk_window_edit_menu_shown (GtkWidget *widget, struct nsgtk_scaffolding *g) |
| gtk event for edit menu being show More... | |
| static gboolean | nsgtk_window_edit_menu_hidden (GtkWidget *widget, struct nsgtk_scaffolding *g) |
| gtk event handler for edit menu being hidden More... | |
| static gboolean | nsgtk_window_popup_menu_hidden (GtkWidget *widget, struct nsgtk_scaffolding *g) |
| gtk event handler for popup menu being hidden. More... | |
| static void | nsgtk_window_tabs_add (GtkNotebook *notebook, GtkWidget *page, guint page_num, struct nsgtk_scaffolding *g) |
| Update the menus when the number of tabs changes. More... | |
| static void | nsgtk_window_tabs_remove (GtkNotebook *notebook, GtkWidget *page, guint page_num, struct nsgtk_scaffolding *gs) |
| Update the menus when the number of tabs changes. More... | |
| static gboolean | nsgtk_on_savelink_activate_menu (GtkMenuItem *widget, gpointer data) |
| static gboolean | nsgtk_on_link_openwin_activate_menu (GtkMenuItem *widget, gpointer data) |
| Handler for opening new window from a link. More... | |
| static gboolean | nsgtk_on_link_opentab_activate_menu (GtkMenuItem *widget, gpointer data) |
| Handler for opening new tab from a link. More... | |
| static gboolean | nsgtk_on_link_bookmark_activate_menu (GtkMenuItem *widget, gpointer data) |
| Handler for bookmarking a link. More... | |
| static gboolean | nsgtk_on_link_copy_activate_menu (GtkMenuItem *widget, gpointer data) |
| Handler for copying a link. More... | |
| static gboolean | nsgtk_on_find_activate_menu (GtkMenuItem *widget, gpointer data) |
| static nserror | get_bar_show (bool *menu, bool *tool) |
| static nserror | set_bar_show (const char *bar, bool show) |
| static gboolean | nsgtk_on_menubar_activate_menu (GtkMenuItem *widget, gpointer data) |
| static gboolean | nsgtk_on_toolbar_activate_menu (GtkMenuItem *widget, gpointer data) |
| static gboolean | nsgtk_on_nexttab_activate_menu (GtkMenuItem *widget, gpointer data) |
| static gboolean | nsgtk_on_prevtab_activate_menu (GtkMenuItem *widget, gpointer data) |
| static gboolean | nsgtk_on_closetab_activate_menu (GtkMenuItem *widget, gpointer data) |
| menu signal handler for activation on close tab item More... | |
| static void | nsgtk_menu_connect_signals (struct nsgtk_scaffolding *g) |
| attach gtk signal handlers for menus More... | |
| static struct nsgtk_bar_submenu * | create_scaffolding_bar_menu (struct nsgtk_scaffolding *gs, GtkAccelGroup *group, bool showmenu, bool showtool) |
| Create and connect handlers to bar menu. More... | |
| static struct nsgtk_burger_menu * | create_scaffolding_burger_menu (struct nsgtk_scaffolding *gs, GtkAccelGroup *group, bool showbar, bool showtool) |
| Create and connect handlers to burger menu. More... | |
| static struct nsgtk_popup_menu * | create_scaffolding_popup_menu (struct nsgtk_scaffolding *gs, GtkAccelGroup *group, bool showbar, bool showtool) |
| Create and connect handlers to popup menu. More... | |
| static struct nsgtk_link_menu * | create_scaffolding_link_menu (struct nsgtk_scaffolding *g, GtkAccelGroup *group) |
| Create and connect handlers to link popup menu. More... | |
| static nserror | nsgtk_menu_initialise (struct nsgtk_scaffolding *g) |
| initialiase the menu signal handlers ready for connection More... | |
| static void | nsgtk_menu_set_sensitivity (struct nsgtk_scaffolding *g) |
| static void | nsgtk_menu_set_icons (struct nsgtk_scaffolding *g) |
| static nserror | nsgtk_menus_create (struct nsgtk_scaffolding *gs) |
| create and initialise menus More... | |
| void | nsgtk_scaffolding_set_title (struct gui_window *gw, const char *title) |
| set the title in the window More... | |
| nserror | nsgtk_scaffolding_throbber (struct gui_window *gw, bool active) |
| Update scaffolding window when throbber state changes. More... | |
| nserror | nsgtk_scaffolding_destroy_all (void) |
| causes all scaffolding windows to be destroyed. More... | |
| GtkWindow * | nsgtk_scaffolding_window (struct nsgtk_scaffolding *g) |
| Get the gtk window for a scaffolding. More... | |
| GtkNotebook * | nsgtk_scaffolding_notebook (struct nsgtk_scaffolding *g) |
| Get the gtk notebook from a scaffold. More... | |
| GtkMenuBar * | nsgtk_scaffolding_menu_bar (struct nsgtk_scaffolding *gs) |
| struct nsgtk_scaffolding * | nsgtk_scaffolding_iterate (struct nsgtk_scaffolding *g) |
| Iterate through available scaffolding. More... | |
| struct gui_window * | nsgtk_scaffolding_top_level (struct nsgtk_scaffolding *g) |
| void | nsgtk_scaffolding_set_top_level (struct gui_window *gw) |
| Set the current active top level gui window. More... | |
| void | nsgtk_scaffolding_set_sensitivity (struct nsgtk_scaffolding *g) |
| update the sensitivity of context sensitive UI elements More... | |
| nserror | nsgtk_scaffolding_toolbar_context_menu (struct nsgtk_scaffolding *gs) |
| open the toolbar context menu More... | |
| nserror | nsgtk_scaffolding_burger_menu (struct nsgtk_scaffolding *gs) |
| open the burger menu More... | |
| void | nsgtk_scaffolding_context_menu (struct nsgtk_scaffolding *g, gdouble x, gdouble y) |
| Open a context sensitive menu. More... | |
| struct nsgtk_scaffolding * | nsgtk_current_scaffolding (void) |
| Obtain the most recently used scaffolding element. More... | |
| struct nsgtk_scaffolding * | nsgtk_scaffolding_from_notebook (GtkNotebook *notebook) |
| find which scaffolding contains a gtk notebook More... | |
| struct nsgtk_scaffolding * | nsgtk_new_scaffolding (struct gui_window *toplevel) |
| create a new scaffolding for a window. More... | |
| nserror | nsgtk_scaffolding_position_page_info (struct nsgtk_scaffolding *gs, struct nsgtk_pi_window *win) |
| Position the page-info popup in the right place. More... | |
| nserror | nsgtk_scaffolding_position_local_history (struct nsgtk_scaffolding *gs) |
| Position the local-history popup in the right place. More... | |
Variables | |
| static struct nsgtk_scaffolding * | scaf_current |
| current scaffold for model dialogue use More... | |
| static struct nsgtk_scaffolding * | scaf_list = NULL |
| global list for interface changes More... | |
| static struct browser_window_features | current_menu_features |
| holds the context data for what's under the pointer, when the contextual menu is opened. More... | |
| #define ITEM_MB | ( | p, | |
| q, | |||
| r | |||
| ) |
| #define ITEM_MBP | ( | p, | |
| q, | |||
| r | |||
| ) |
| #define ITEM_MBp | ( | p, | |
| q, | |||
| r | |||
| ) |
| #define SENSITIVITY | ( | q | ) |
| #define TOOLBAR_ITEM | ( | identifier, | |
| name, | |||
| sensitivity, | |||
| clicked, | |||
| activate, | |||
| label, | |||
| iconame | |||
| ) | TOOLBAR_ITEM_ ## activate(identifier, name) |
Definition at line 487 of file scaffolding.c.
| #define TOOLBAR_ITEM | ( | identifier, | |
| name, | |||
| snstvty, | |||
| clicked, | |||
| activate, | |||
| label, | |||
| iconame | |||
| ) |
Definition at line 487 of file scaffolding.c.
| #define TOOLBAR_ITEM_n | ( | identifier, | |
| name | |||
| ) |
Definition at line 486 of file scaffolding.c.
| #define TOOLBAR_ITEM_n | ( | identifier, | |
| name, | |||
| iconame | |||
| ) |
Definition at line 486 of file scaffolding.c.
| #define TOOLBAR_ITEM_p | ( | identifier, | |
| name | |||
| ) |
handle menu activate signals by calling toolbar item activation
Definition at line 477 of file scaffolding.c.
| #define TOOLBAR_ITEM_p | ( | identifier, | |
| name, | |||
| iconame | |||
| ) |
handle menu activate signals by calling toolbar item activation
Definition at line 477 of file scaffolding.c.
| #define TOOLBAR_ITEM_y | ( | identifier, | |
| name | |||
| ) |
Definition at line 485 of file scaffolding.c.
| #define TOOLBAR_ITEM_y | ( | identifier, | |
| name, | |||
| iconame | |||
| ) |
Definition at line 485 of file scaffolding.c.
|
static |
Create and connect handlers to bar menu.
| gs | scaffolding to attach popup menu to. |
| group | The accelerator group to use for the popup. |
| showmenu | if the bar menu should be shown |
| showtool | if the toolabar should be shown |
Definition at line 837 of file scaffolding.c.
References nsgtk_bar_submenu::bar_menu, nsgtk_scaffolding::builder, nsgtk_edit_menu::edit, nsgtk_bar_submenu::edit_submenu, nsgtk_toolbars_submenu::menubar_menuitem, nsgtk_menu_bar_create(), nsgtk_on_menubar_activate_menu(), nsgtk_on_toolbar_activate_menu(), nsgtk_window_edit_menu_hidden(), nsgtk_window_edit_menu_shown(), nsgtk_toolbars_submenu::toolbar_menuitem, nsgtk_view_menu::toolbars_submenu, and nsgtk_bar_submenu::view_submenu.
Referenced by nsgtk_menus_create().
|
static |
Create and connect handlers to burger menu.
| g | scaffolding to attach popup menu to. |
| group | The accelerator group to use for the popup. |
| showbar | if the bar menu should be shown |
| showtool | if the toolabar should be shown |
Definition at line 903 of file scaffolding.c.
References nsgtk_toolbars_submenu::menubar_menuitem, nsgtk_burger_menu_create(), nsgtk_on_menubar_activate_menu(), nsgtk_on_toolbar_activate_menu(), nsgtk_toolbars_submenu::toolbar_menuitem, nsgtk_view_menu::toolbars_submenu, and nsgtk_burger_menu::view_submenu.
Referenced by nsgtk_menus_create().
|
static |
Create and connect handlers to link popup menu.
| g | scaffolding to attach popup menu to. |
| group | The accelerator group to use for the popup. |
Definition at line 987 of file scaffolding.c.
References nsgtk_link_menu::bookmark_menuitem, nsgtk_link_menu::copy_menuitem, nsgtk_link_menu_create(), nsgtk_on_link_bookmark_activate_menu(), nsgtk_on_link_copy_activate_menu(), nsgtk_on_link_opentab_activate_menu(), nsgtk_on_link_openwin_activate_menu(), nsgtk_on_savelink_activate_menu(), nsgtk_link_menu::opentab_menuitem, nsgtk_link_menu::openwin_menuitem, and nsgtk_link_menu::save_menuitem.
Referenced by nsgtk_menus_create().
|
static |
Create and connect handlers to popup menu.
| gs | scaffolding to attach popup menu to. |
| group | The accelerator group to use for the popup. |
| showbar | if the bar menu should be shown |
| showtool | if the toolabar should be shown |
Definition at line 942 of file scaffolding.c.
References nsgtk_toolbars_submenu::menubar_menuitem, nsgtk_on_menubar_activate_menu(), nsgtk_on_toolbar_activate_menu(), nsgtk_popup_menu_create(), nsgtk_window_popup_menu_hidden(), nsgtk_popup_menu::popup_menu, popup_menu_hide(), nsgtk_toolbars_submenu::toolbar_menuitem, and nsgtk_popup_menu::toolbars_submenu.
Referenced by nsgtk_menus_create().
|
static |
Definition at line 615 of file scaffolding.c.
References NSERROR_OK, and nsoption_charp.
Referenced by nsgtk_menus_create(), and set_bar_show().
| struct nsgtk_scaffolding * nsgtk_current_scaffolding | ( | void | ) |
Obtain the most recently used scaffolding element.
This allows tabs to be opened in the most recently used window
Definition at line 1473 of file scaffolding.c.
References scaf_current, and scaf_list.
Referenced by gui_window_create(), nsgtk_local_history_present(), nsgtk_page_info(), and nsgtk_show_uri().
|
static |
attach gtk signal handlers for menus
Definition at line 801 of file scaffolding.c.
References BACK_BUTTON, nsgtk_menu::burger, nsgtk_menu::main, nsgtk_scaffolding::menus, nsgtk_menu::mhandler, PLACEHOLDER_BUTTON, and nsgtk_menu::popup.
Referenced by nsgtk_menus_create().
|
static |
initialiase the menu signal handlers ready for connection
Definition at line 1029 of file scaffolding.c.
References CUSTOMIZE_BUTTON, nsgtk_toolbars_submenu::customize_menuitem, ITEM_MB, ITEM_MBP, ITEM_MBp, nsgtk_scaffolding::menus, NSERROR_OK, nsgtk_menu::popup, nsgtk_scaffolding::popup_menu, reload, nsgtk_popup_menu::toolbars_submenu, and view.
Referenced by nsgtk_menus_create().
|
static |
Definition at line 1163 of file scaffolding.c.
References BACK_BUTTON, nsgtk_menu::burger, nsgtk_menu::iconname, nsgtk_menu::main, nsgtk_scaffolding::menus, nsgtk_image_menu_item_set_image(), PLACEHOLDER_BUTTON, and nsgtk_menu::popup.
Referenced by nsgtk_menus_create().
|
static |
Definition at line 1139 of file scaffolding.c.
References BACK_BUTTON, nsgtk_menu::burger, nsgtk_menu::main, nsgtk_scaffolding::menus, PLACEHOLDER_BUTTON, nsgtk_menu::popup, and nsgtk_menu::sensitivity.
Referenced by nsgtk_menus_create().
|
static |
create and initialise menus
There are four menus held by the scaffolding:
The cut, copy, paste, delete and back, forwards, stop, reload groups of menu entries are context sensitive and must be updated as appropriate when a menu is opened which contains those groups.
Definition at line 1211 of file scaffolding.c.
References nsgtk_scaffolding::burger_menu, create_scaffolding_bar_menu(), create_scaffolding_burger_menu(), create_scaffolding_link_menu(), create_scaffolding_popup_menu(), get_bar_show(), nsgtk_scaffolding::link_menu, nsgtk_scaffolding::menu_bar, NSERROR_OK, nsgtk_menu_connect_signals(), nsgtk_menu_initialise(), nsgtk_menu_set_icons(), nsgtk_menu_set_sensitivity(), nsgtk_scaffolding::popup_menu, and nsgtk_scaffolding::window.
Referenced by nsgtk_new_scaffolding().
| struct nsgtk_scaffolding * nsgtk_new_scaffolding | ( | struct gui_window * | gw | ) |
create a new scaffolding for a window.
| gw | The gui window to create the new scaffold around. |
set this window's size and position to what's in the options, or some sensible default if they are not set yet.
Definition at line 1496 of file scaffolding.c.
References nsgtk_scaffolding::builder, nsgtk_scaffolding::next, nsgtk_scaffolding::notebook, NSERROR_OK, nsgtk_builder_new_from_resname(), nsgtk_menus_create(), nsgtk_notebook_create(), nsgtk_window_tabs_add(), nsgtk_window_tabs_remove(), NSLOG, nsoption_int, nsgtk_scaffolding::prev, scaf_list, scaffolding_window_delete_event(), scaffolding_window_destroy(), nsgtk_scaffolding::tabs_remove_handler_id, nsgtk_scaffolding::top_level, and nsgtk_scaffolding::window.
Referenced by gui_window_create().
|
static |
menu signal handler for activation on close tab item
Definition at line 787 of file scaffolding.c.
References nsgtk_scaffolding::notebook, and nsgtk_tab_close_current().
|
static |
Definition at line 606 of file scaffolding.c.
References nsgtk_window_search_toggle(), and nsgtk_scaffolding::top_level.
|
static |
Handler for bookmarking a link.
attached to the popup menu.
Definition at line 576 of file scaffolding.c.
References current_menu_features, hotlist_add_url(), and browser_window_features::link.
Referenced by create_scaffolding_link_menu().
|
static |
Handler for copying a link.
attached to the popup menu.
Definition at line 591 of file scaffolding.c.
References clipboard, current_menu_features, browser_window_features::link, and nsurl_access().
Referenced by create_scaffolding_link_menu().
|
static |
Handler for opening new tab from a link.
attached to the popup menu.
Definition at line 550 of file scaffolding.c.
References browser_window_create(), browser_window::bw, BW_CREATE_CLONE, BW_CREATE_HISTORY, BW_CREATE_TAB, current_menu_features, gui_window::gui, browser_window_features::link, messages_get_errorcode(), NSERROR_OK, nsgtk_get_browser_window(), nsgtk_warning(), and nsgtk_scaffolding::top_level.
Referenced by create_scaffolding_link_menu().
|
static |
Handler for opening new window from a link.
attached to the popup menu.
Definition at line 526 of file scaffolding.c.
References browser_window_create(), browser_window::bw, BW_CREATE_CLONE, BW_CREATE_HISTORY, current_menu_features, gui_window::gui, browser_window_features::link, messages_get_errorcode(), NSERROR_OK, nsgtk_get_browser_window(), nsgtk_warning(), and nsgtk_scaffolding::top_level.
Referenced by create_scaffolding_link_menu().
|
static |
Definition at line 666 of file scaffolding.c.
References nsgtk_bar_submenu::bar_menu, nsgtk_scaffolding::burger_menu, nsgtk_scaffolding::menu_bar, nsgtk_toolbars_submenu::menubar_menuitem, nsgtk_scaffolding::popup_menu, set_bar_show(), nsgtk_view_menu::toolbars_submenu, nsgtk_popup_menu::toolbars_submenu, nsgtk_bar_submenu::view_submenu, and nsgtk_burger_menu::view_submenu.
Referenced by create_scaffolding_bar_menu(), create_scaffolding_burger_menu(), and create_scaffolding_popup_menu().
|
static |
Definition at line 762 of file scaffolding.c.
References nsgtk_scaffolding::notebook, and nsgtk_tab_next().
|
static |
Definition at line 773 of file scaffolding.c.
References nsgtk_scaffolding::notebook, and nsgtk_tab_prev().
|
static |
Definition at line 497 of file scaffolding.c.
References browser_window_navigate(), browser_window::bw, BW_NAVIGATE_DOWNLOAD, current_menu_features, gui_window::gui, browser_window_features::link, messages_get_errorcode(), NSERROR_OK, nsgtk_get_browser_window(), nsgtk_warning(), and nsgtk_scaffolding::top_level.
Referenced by create_scaffolding_link_menu().
|
static |
Definition at line 714 of file scaffolding.c.
References nsgtk_scaffolding::burger_menu, nsgtk_scaffolding::menu_bar, nsgtk_window_toolbar_show(), nsgtk_scaffolding::popup_menu, set_bar_show(), nsgtk_toolbars_submenu::toolbar_menuitem, nsgtk_view_menu::toolbars_submenu, nsgtk_popup_menu::toolbars_submenu, nsgtk_bar_submenu::view_submenu, and nsgtk_burger_menu::view_submenu.
Referenced by create_scaffolding_bar_menu(), create_scaffolding_burger_menu(), and create_scaffolding_popup_menu().
| nserror nsgtk_scaffolding_burger_menu | ( | struct nsgtk_scaffolding * | gs | ) |
open the burger menu
Definition at line 1419 of file scaffolding.c.
References nsgtk_burger_menu::burger_menu, nsgtk_scaffolding::burger_menu, NSERROR_OK, and nsgtk_menu_popup_at_pointer().
Referenced by openmenu_button_clicked_cb().
| void nsgtk_scaffolding_context_menu | ( | struct nsgtk_scaffolding * | g, |
| gdouble | x, | ||
| gdouble | y | ||
| ) |
Open a context sensitive menu.
| g | the scaffolding containing the browser window. |
| x | The x co-ordinate. |
| y | The y co-ordinate. |
Definition at line 1429 of file scaffolding.c.
References browser_window_get_features(), browser_window::bw, COPY_BUTTON, nsgtk_popup_menu::copy_menuitem, current_menu_features, CUT_BUTTON, nsgtk_popup_menu::cut_menuitem, browser_window_features::link, nsgtk_link_menu::link_menu, nsgtk_scaffolding::link_menu, nsgtk_scaffolding::menus, nsgtk_get_browser_window(), nsgtk_menu_popup_at_pointer(), nsgtk_scaffolding_update_edit_actions_sensitivity(), PASTE_BUTTON, nsgtk_popup_menu::paste_menuitem, nsgtk_popup_menu::popup_menu, nsgtk_scaffolding::popup_menu, nsgtk_menu::sensitivity, nsgtk_scaffolding::top_level, browser_window::x, and browser_window::y.
Referenced by nsgtk_window_button_press_event().
| nserror nsgtk_scaffolding_destroy_all | ( | void | ) |
causes all scaffolding windows to be destroyed.
Definition at line 1288 of file scaffolding.c.
References nsgtk_scaffolding::next, NSERROR_INVALID, NSERROR_OK, nsgtk_check_for_downloads(), scaf_list, and nsgtk_scaffolding::window.
Referenced by quit_button_clicked_cb().
|
static |
make edit actions sensitive
| g | The scaffolding context. |
Definition at line 331 of file scaffolding.c.
References COPY_BUTTON, CUT_BUTTON, nsgtk_scaffolding::menus, nsgtk_scaffolding_set_sensitivity(), PASTE_BUTTON, nsgtk_scaffolding::popup_menu, popup_menu_show(), and nsgtk_menu::sensitivity.
Referenced by nsgtk_window_edit_menu_hidden(), and nsgtk_window_popup_menu_hidden().
| struct nsgtk_scaffolding * nsgtk_scaffolding_from_notebook | ( | GtkNotebook * | notebook | ) |
find which scaffolding contains a gtk notebook
| notebook | The notebook to search for. |
Definition at line 1482 of file scaffolding.c.
References nsgtk_scaffolding::next, nsgtk_scaffolding::notebook, and scaf_list.
Referenced by nsgtk_tab_switch_page_after().
| struct nsgtk_scaffolding * nsgtk_scaffolding_iterate | ( | struct nsgtk_scaffolding * | g | ) |
Iterate through available scaffolding.
Definition at line 1332 of file scaffolding.c.
References nsgtk_scaffolding::next, and scaf_list.
| GtkMenuBar * nsgtk_scaffolding_menu_bar | ( | struct nsgtk_scaffolding * | gs | ) |
Definition at line 1323 of file scaffolding.c.
References nsgtk_bar_submenu::bar_menu, and nsgtk_scaffolding::menu_bar.
Referenced by nsgtk_tab_switch_page_after().
| GtkNotebook * nsgtk_scaffolding_notebook | ( | struct nsgtk_scaffolding * | g | ) |
Get the gtk notebook from a scaffold.
Definition at line 1316 of file scaffolding.c.
References nsgtk_scaffolding::notebook.
Referenced by nsgtk_tab_add(), and nsgtk_window_update_all().
| nserror nsgtk_scaffolding_position_local_history | ( | struct nsgtk_scaffolding * | gs | ) |
Position the local-history popup in the right place.
| gs | The scaffolding to position relative to |
Definition at line 1600 of file scaffolding.c.
References nsgtk_window_position_local_history(), and nsgtk_scaffolding::top_level.
Referenced by nsgtk_local_history_present().
| nserror nsgtk_scaffolding_position_page_info | ( | struct nsgtk_scaffolding * | gs, |
| struct nsgtk_pi_window * | win | ||
| ) |
Position the page-info popup in the right place.
| gs | The scaffolding to position relative to |
| win | The page-info window to position |
Definition at line 1593 of file scaffolding.c.
References nsgtk_window_position_page_info(), and nsgtk_scaffolding::top_level.
Referenced by nsgtk_page_info().
| void nsgtk_scaffolding_set_sensitivity | ( | struct 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
Definition at line 1376 of file scaffolding.c.
References SENSITIVITY.
Referenced by nsgtk_scaffolding_enable_edit_actions_sensitivity(), nsgtk_scaffolding_update_edit_actions_sensitivity(), nsgtk_window_tabs_add(), nsgtk_window_tabs_remove(), and scaffolding_update_context().
| void nsgtk_scaffolding_set_title | ( | struct gui_window * | gw, |
| const char * | title | ||
| ) |
set the title in the window
| gw | The gui window to set title on |
| title | The title to set which may be NULL |
Definition at line 1239 of file scaffolding.c.
References nsgtk_get_scaffold(), SLEN, nsgtk_scaffolding::top_level, and nsgtk_scaffolding::window.
Referenced by gui_window_set_title(), and nsgtk_scaffolding_set_top_level().
| void nsgtk_scaffolding_set_top_level | ( | struct gui_window * | gw | ) |
Set the current active top level gui window.
Definition at line 1349 of file scaffolding.c.
References browser_window_get_title(), browser_window::bw, nsgtk_get_browser_window(), nsgtk_get_scaffold(), nsgtk_scaffolding_set_title(), scaf_current, scaffolding_update_context(), and nsgtk_scaffolding::top_level.
Referenced by nsgtk_tab_switch_page_after().
| nserror nsgtk_scaffolding_throbber | ( | struct gui_window * | gw, |
| bool | active | ||
| ) |
Update scaffolding window when throbber state changes.
Definition at line 1271 of file scaffolding.c.
References nsgtk_scaffolding::menus, NSERROR_OK, nsgtk_get_scaffold(), RELOAD_BUTTON, scaffolding_update_context(), nsgtk_menu::sensitivity, and STOP_BUTTON.
Referenced by throbber().
| nserror nsgtk_scaffolding_toolbar_context_menu | ( | struct nsgtk_scaffolding * | gs | ) |
open the toolbar context menu
Definition at line 1407 of file scaffolding.c.
References NSERROR_OK, nsgtk_menu_popup_at_pointer(), nsgtk_popup_menu::popup_menu, nsgtk_scaffolding::popup_menu, and popup_menu_hide().
Referenced by toolbar_popup_context_menu_cb().
| struct gui_window * nsgtk_scaffolding_top_level | ( | struct nsgtk_scaffolding * | g | ) |
Definition at line 1342 of file scaffolding.c.
References nsgtk_scaffolding::top_level.
|
static |
edit the sensitivity of focused widget
| g | The scaffolding context. |
Definition at line 290 of file scaffolding.c.
References browser_window_get_editor_flags(), browser_window::bw, BW_EDITOR_CAN_COPY, BW_EDITOR_CAN_CUT, BW_EDITOR_CAN_PASTE, COPY_BUTTON, CUT_BUTTON, nsgtk_scaffolding::menus, nsgtk_get_browser_window(), nsgtk_scaffolding_set_sensitivity(), PASTE_BUTTON, nsgtk_menu::sensitivity, nsgtk_scaffolding::top_level, and nsgtk_scaffolding::window.
Referenced by nsgtk_scaffolding_context_menu(), and nsgtk_window_edit_menu_shown().
| GtkWindow * nsgtk_scaffolding_window | ( | struct nsgtk_scaffolding * | g | ) |
Get the gtk window for a scaffolding.
Definition at line 1310 of file scaffolding.c.
References nsgtk_scaffolding::window.
Referenced by gui_download_window_create(), gui_window_file_gadget_open(), nsgtk_page_info(), and nsgtk_show_uri().
|
static |
gtk event handler for edit menu being hidden
| widget | The menu widget |
| g | scaffolding handle |
Definition at line 367 of file scaffolding.c.
References nsgtk_scaffolding_enable_edit_actions_sensitivity().
Referenced by create_scaffolding_bar_menu().
|
static |
gtk event for edit menu being show
| widget | The menu widget |
| g | scaffolding handle |
Definition at line 351 of file scaffolding.c.
References nsgtk_scaffolding_update_edit_actions_sensitivity().
Referenced by create_scaffolding_bar_menu().
|
static |
gtk event handler for popup menu being hidden.
| widget | The menu widget |
| g | scaffolding handle |
Definition at line 384 of file scaffolding.c.
References nsgtk_scaffolding_enable_edit_actions_sensitivity().
Referenced by create_scaffolding_popup_menu().
|
static |
Update the menus when the number of tabs changes.
toolbar sensitivity
next/previous tab ought to only be visible if there is such a tab
| notebook | The notebook all the tabs are in |
| page | The newly added page container widget |
| page_num | The index of the newly added page |
| g | The scaffolding context containing the notebook |
Definition at line 403 of file scaffolding.c.
References nsgtk_scaffolding::burger_menu, CLOSETAB_BUTTON, nsgtk_scaffolding::menu_bar, nsgtk_scaffolding::menus, NEXTTAB_BUTTON, nsgtk_scaffolding::notebook, nsgtk_scaffolding_set_sensitivity(), PREVTAB_BUTTON, nsgtk_menu::sensitivity, nsgtk_view_menu::tabs_menuitem, nsgtk_bar_submenu::view_submenu, and nsgtk_burger_menu::view_submenu.
Referenced by nsgtk_new_scaffolding().
|
static |
Update the menus when the number of tabs changes.
| notebook | The notebook all the tabs are in |
| page | The page container widget being removed |
| page_num | The index of the removed page |
| gs | The scaffolding context containing the notebook |
Definition at line 437 of file scaffolding.c.
References nsgtk_scaffolding::burger_menu, CLOSETAB_BUTTON, gtk_widget_in_destruction, nsgtk_scaffolding::menu_bar, nsgtk_scaffolding::menus, NEXTTAB_BUTTON, nsgtk_scaffolding::notebook, nsgtk_scaffolding_set_sensitivity(), PREVTAB_BUTTON, nsgtk_menu::sensitivity, nsgtk_view_menu::tabs_menuitem, nsgtk_bar_submenu::view_submenu, nsgtk_burger_menu::view_submenu, and nsgtk_scaffolding::window.
Referenced by nsgtk_new_scaffolding().
|
static |
Helper to hide popup menu entries by grouping.
| menu | The popup menu to modify. |
| nav | flag to indicate if navigation entries should be hidden. |
| cnp | flag to indicate if cut and paste entries should be hidden. |
| custom | flag to indicate if menu customisation is hidden. |
Definition at line 125 of file scaffolding.c.
References nsgtk_popup_menu::back_menuitem, nsgtk_popup_menu::copy_menuitem, nsgtk_popup_menu::cut_menuitem, nsgtk_popup_menu::first_separator, nsgtk_popup_menu::forward_menuitem, nsgtk_popup_menu::paste_menuitem, nsgtk_popup_menu::reload_menuitem, nsgtk_popup_menu::second_separator, and nsgtk_popup_menu::stop_menuitem.
Referenced by create_scaffolding_popup_menu(), and nsgtk_scaffolding_toolbar_context_menu().
|
static |
Helper to show popup menu entries by grouping.
| menu | The popup menu to modify. |
| nav | flag to indicate if navigation entries should be visible. |
| cnp | flag to indicate if cut and paste entries should be visible. |
| custom | flag to indicate if menu customisation is visible. |
Definition at line 157 of file scaffolding.c.
References nsgtk_popup_menu::back_menuitem, nsgtk_popup_menu::copy_menuitem, nsgtk_popup_menu::cut_menuitem, nsgtk_popup_menu::first_separator, nsgtk_popup_menu::forward_menuitem, nsgtk_popup_menu::paste_menuitem, nsgtk_popup_menu::reload_menuitem, nsgtk_popup_menu::second_separator, and nsgtk_popup_menu::stop_menuitem.
Referenced by nsgtk_scaffolding_enable_edit_actions_sensitivity().
|
static |
Update the scaffolding controls.
The button sensitivity, url bar and local history visibility are updated
| g | The scaffolding context to update |
Definition at line 267 of file scaffolding.c.
References BACK_BUTTON, browser_window_history_back_available(), browser_window_history_forward_available(), browser_window::bw, FORWARD_BUTTON, nsgtk_scaffolding::menus, nsgtk_get_browser_window(), nsgtk_local_history_hide(), nsgtk_scaffolding_set_sensitivity(), nsgtk_menu::sensitivity, and nsgtk_scaffolding::top_level.
Referenced by nsgtk_scaffolding_set_top_level(), and nsgtk_scaffolding_throbber().
|
static |
gtk event callback on window delete event.
prevent window close if download is in progress
| widget | The widget receiving the delete event |
| event | The event |
| data | The context pointer passed when the connection was made. |
Definition at line 247 of file scaffolding.c.
References nsgtk_check_for_downloads(), and nsgtk_scaffolding::window.
Referenced by nsgtk_new_scaffolding().
|
static |
resource cleanup function for window destruction.
gtk event called when window is being destroyed. Need to free any resources associated with this scaffold,
| widget | the widget being destroyed |
| data | The context pointer passed when the connection was made. |
Definition at line 188 of file scaffolding.c.
References nsgtk_scaffolding::burger_menu, nsgtk_scaffolding::link_menu, nsgtk_scaffolding::menu_bar, nsgtk_scaffolding::next, nsgtk_scaffolding::notebook, nsgtk_burger_menu_destroy(), nsgtk_complete, nsgtk_link_menu_destroy(), nsgtk_local_history_hide(), nsgtk_menu_bar_destroy(), nsgtk_popup_menu_destroy(), NSLOG, nsgtk_scaffolding::popup_menu, nsgtk_scaffolding::prev, scaf_current, scaf_list, and nsgtk_scaffolding::tabs_remove_handler_id.
Referenced by nsgtk_new_scaffolding().
|
static |
Definition at line 637 of file scaffolding.c.
References get_bar_show(), NSERROR_OK, and nsoption_set_charp.
Referenced by nsgtk_on_menubar_activate_menu(), and nsgtk_on_toolbar_activate_menu().
|
static |
holds the context data for what's under the pointer, when the contextual menu is opened.
Definition at line 113 of file scaffolding.c.
Referenced by nsgtk_on_link_bookmark_activate_menu(), nsgtk_on_link_copy_activate_menu(), nsgtk_on_link_opentab_activate_menu(), nsgtk_on_link_openwin_activate_menu(), nsgtk_on_savelink_activate_menu(), and nsgtk_scaffolding_context_menu().
|
static |
current scaffold for model dialogue use
Definition at line 102 of file scaffolding.c.
Referenced by nsgtk_current_scaffolding(), nsgtk_scaffolding_set_top_level(), and scaffolding_window_destroy().
|
static |
global list for interface changes
Definition at line 107 of file scaffolding.c.
Referenced by nsgtk_current_scaffolding(), nsgtk_new_scaffolding(), nsgtk_scaffolding_destroy_all(), nsgtk_scaffolding_from_notebook(), nsgtk_scaffolding_iterate(), and scaffolding_window_destroy().