NetSurf
Data Structures | Macros | Enumerations | Functions | Variables
toolbar.c File Reference

implementation of toolbar to control browsing context More...

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <gtk/gtk.h>
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/nsoption.h"
#include "utils/file.h"
#include "utils/nsurl.h"
#include "utils/corestrings.h"
#include "desktop/browser_history.h"
#include "desktop/searchweb.h"
#include "desktop/search.h"
#include "desktop/save_complete.h"
#include "desktop/save_text.h"
#include "desktop/print.h"
#include "desktop/hotlist.h"
#include "netsurf/content.h"
#include "netsurf/browser_window.h"
#include "netsurf/keypress.h"
#include "gtk/toolbar_items.h"
#include "gtk/completion.h"
#include "gtk/gui.h"
#include "gtk/warn.h"
#include "gtk/search.h"
#include "gtk/throbber.h"
#include "gtk/scaffolding.h"
#include "gtk/window.h"
#include "gtk/compat.h"
#include "gtk/resources.h"
#include "gtk/schedule.h"
#include "gtk/local_history.h"
#include "gtk/global_history.h"
#include "gtk/viewsource.h"
#include "gtk/download.h"
#include "gtk/viewdata.h"
#include "gtk/tabs.h"
#include "gtk/print.h"
#include "gtk/layout_pango.h"
#include "gtk/preferences.h"
#include "gtk/hotlist.h"
#include "gtk/cookies.h"
#include "gtk/about.h"
#include "gtk/gdk.h"
#include "gtk/bitmap.h"
#include "gtk/page_info.h"
#include "gtk/toolbar.h"
Include dependency graph for toolbar.c:

Go to the source code of this file.

Data Structures

struct  nsgtk_toolbar_item
 toolbar item context More...
 
struct  nsgtk_toolbar
 control toolbar context More...
 
struct  nsgtk_toolbar_customisation
 toolbar cusomisation context More...
 

Macros

#define INACTIVE_LOCATION   (-1)
 button location indicating button is not to be shown More...
 
#define THROBBER_FRAME_TIME   (100)
 time (in ms) between throbber animation frame updates More...
 
#define NSGTK_MIN_STORE_COLUMNS   4
 the minimum number of columns in the tool store More...
 
#define NSGTK_BUTTON_WIDTH   120
 the 'standard' width of a button that makes sufficient of its label visible More...
 
#define NSGTK_BUTTON_HEIGHT   70
 the 'standard' height of a button that fits as many toolbars as possible into the store More...
 
#define NSGTK_WEBSEARCH_WIDTH   150
 the 'normal' width of the websearch bar More...
 
#define TOOLBAR_ITEM_y(identifier, label, iconame)
 
#define TOOLBAR_ITEM_n(identifier, label, iconame)
 
#define TOOLBAR_ITEM_t(identifier, label, iconame)
 
#define TOOLBAR_ITEM_b(identifier, label, iconame)
 
#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate, label, iconame)    TOOLBAR_ITEM_ ## clicked(identifier, label, iconame)
 
#define TOOLBAR_ITEM_y(identifier, label, iconame)
 
#define TOOLBAR_ITEM_n(identifier, label, iconame)
 
#define TOOLBAR_ITEM_t(identifier, label, iconame)
 
#define TOOLBAR_ITEM_b(identifier, label, iconame)
 
#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate, label, iconame)    TOOLBAR_ITEM_ ## clicked(identifier, label, iconame)
 
#define TOOLBAR_ITEM(identifier, name, snstvty, clicked, activate, label, iconame)
 
#define TOOLBAR_ITEM_t(name)    item->clicked = name##_button_clicked_cb;
 
#define TOOLBAR_ITEM_b(name)    item->clicked = name##_button_clicked_cb;
 
#define TOOLBAR_ITEM_y(name)    item->clicked = name##_button_clicked_cb;
 
#define TOOLBAR_ITEM_n(name)    item->clicked = NULL;
 
#define TOOLBAR_ITEM(identifier, iname, snstvty, clicked, activate, label, iconame)
 

Enumerations

enum  nsgtk_toolbar_location_focus_state { LFS_IDLE , LFS_WANT , LFS_THROB , LFS_LAST }
 Location focus state machine. More...
 

Functions

static nserror toolbar_item_create (nsgtk_toolbar_button id, struct nsgtk_toolbar_item *item)
 create a toolbar item More...
 
static char * remove_underscores (const char *s, bool replacespace)
 returns a string without its underscores More...
 
static GtkToolItem * make_toolbar_item_throbber (bool sensitivity, bool edit)
 create throbber toolbar item widget More...
 
static GtkToolItem * make_toolbar_item_url_bar (bool sensitivity, bool edit)
 create url bar toolbar item widget More...
 
static GtkToolItem * make_toolbar_item_websearch (bool sensitivity, bool edit)
 create web search toolbar item widget More...
 
static GtkToolItem * make_toolbar_item_history (bool sensitivity, bool edit)
 create local history toolbar item widget More...
 
static GtkToolItem * make_toolbar_item_button (const char *labelmsg, const char *iconname, bool sensitivity, bool edit)
 create generic button toolbar item widget More...
 
static GtkToolItem * make_toolbar_item (nsgtk_toolbar_button itemid, bool sensitivity)
 widget factory for creation of toolbar item widgets More...
 
static GtkToolItem * make_toolbox_item (nsgtk_toolbar_button itemid, bool bar)
 widget factory for creation of toolbar item widgets for the toolbox More...
 
static nsgtk_toolbar_button itemid_from_location (struct nsgtk_toolbar *tb, int location)
 find the toolbar item with a given location. More...
 
static nserror nsgtk_toolbar_customisation_save (struct nsgtk_toolbar *tb)
 save toolbar settings to file More...
 
static nserror toolbar_item_connect_signals (struct nsgtk_toolbar *tb, int itemid)
 connect signals to a toolbar item in a customisation toolbar More...
 
static gboolean customisation_container_drag_drop_cb (GtkWidget *widget, GdkDragContext *gdc, gint x, gint y, guint time, gpointer data)
 customisation container handler for drag drop signal More...
 
static gboolean customisation_container_drag_motion_cb (GtkWidget *widget, GdkDragContext *gdc, gint x, gint y, guint time, gpointer data)
 customisation container handler for drag motion signal More...
 
static gboolean customisation_toolbar_drag_drop_cb (GtkWidget *widget, GdkDragContext *gdc, gint x, gint y, guint time, gpointer data)
 customisation toolbar handler for drag drop signal More...
 
static gboolean customisation_toolbar_drag_data_received_cb (GtkWidget *widget, GdkDragContext *gdc, gint x, gint y, GtkSelectionData *selection, guint info, guint time, gpointer data)
 customisation toolbar handler for drag data received signal More...
 
static gboolean customisation_toolbar_drag_motion_cb (GtkWidget *widget, GdkDragContext *gdc, gint x, gint y, guint time, gpointer data)
 customisation toolbar handler for drag motion signal More...
 
static void customisation_toolbar_drag_leave_cb (GtkWidget *widget, GdkDragContext *gdc, guint time, gpointer data)
 customisation toolbar handler for drag leave signal More...
 
static nserror nsgtk_browser_window_create (struct browser_window *bw, bool intab)
 create a new browser window More...
 
static nserror apply_user_button_customisation (struct nsgtk_toolbar *tb)
 Apply the user toolbar button settings from configuration. More...
 
static void container_remove_widget (GtkWidget *widget, gpointer data)
 callback function to remove a widget from a container More...
 
static nserror populate_gtk_toolbar_widget (struct nsgtk_toolbar *tb)
 populates a toolbar with widgets in correct order More...
 
static nserror customisation_toolbar_populate (struct nsgtk_toolbar *tb)
 populates the customization toolbar with widgets in correct order More...
 
static nsgtk_toolbar_button itemid_from_gtktoolitem (struct nsgtk_toolbar *tb, GtkToolItem *toolitem)
 find the toolbar item with a given gtk widget. More...
 
static nserror set_item_sensitivity (struct nsgtk_toolbar_item *item, bool sensitivity)
 set a toolbar items sensitivity More...
 
static nserror set_item_action (struct nsgtk_toolbar *tb, int itemid, bool alt)
 set an item to its alternative action More...
 
static nserror toolbar_navigate_to_url (struct nsgtk_toolbar *tb, const char *urltxt)
 cause the toolbar browsing context to navigate to a new url. More...
 
static nserror nsgtk_saveas_dialog (struct browser_window *bw, const char *title, GtkWindow *parent, bool folder, gchar **path_out)
 run a gtk file chooser as a save dialog to obtain a path More...
 
static nserror toolbar_customisation_connect_signals (struct nsgtk_toolbar *tb)
 connect all signals to widgets in a customisation More...
 
static void item_size_allocate_cb (GtkWidget *widget, GdkRectangle *alloc, gpointer user_data)
 
static nserror add_toolbox_row (struct nsgtk_toolbar_customisation *tbc, int startitem, int enditem)
 add a row to a toolbar customisation toolbox More...
 
static nserror toolbar_customisation_create_toolbox (struct nsgtk_toolbar_customisation *tbc, int width)
 creates widgets in customisation toolbox More...
 
static nserror customisation_toolbar_update (struct nsgtk_toolbar_customisation *tbc)
 update toolbar in customisation to user settings More...
 
static gboolean customisation_apply_clicked_cb (GtkWidget *widget, gpointer data)
 customisation apply handler for clicked signal More...
 
static gboolean customisation_reset_clicked_cb (GtkWidget *widget, gpointer data)
 customisation reset handler for clicked signal More...
 
static void customisation_container_destroy_cb (GtkWidget *widget, gpointer data)
 customisation container destroy handler More...
 
static gboolean cutomize_button_clicked_cb (GtkWidget *widget, gpointer data)
 create a toolbar customisation tab More...
 
static void toolbar_item_size_allocate_cb (GtkWidget *widget, GtkAllocation *alloc, gpointer data)
 callback for all toolbar items widget size allocation More...
 
static gboolean back_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for back tool bar item clicked signal More...
 
static gboolean forward_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for forward tool bar item clicked signal More...
 
static gboolean stop_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for stop tool bar item clicked signal More...
 
static gboolean reload_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for reload tool bar item clicked signal More...
 
static gboolean reloadstop_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for reload/stop tool bar item clicked signal More...
 
static gboolean home_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for home tool bar item clicked signal More...
 
static gboolean url_entry_activate_cb (GtkWidget *widget, gpointer data)
 callback for url entry widget activation More...
 
static gboolean url_entry_changed_cb (GtkWidget *widget, GdkEventKey *event, gpointer data)
 callback for url entry widget changing More...
 
static void url_entry_icon_release_cb (GtkEntry *entry, GtkEntryIconPosition icon_pos, GdkEvent *event, gpointer data)
 callback for url entry widget icon button release More...
 
static gboolean websearch_entry_activate_cb (GtkWidget *widget, gpointer data)
 handler for web search tool bar entry item activate signal More...
 
static gboolean websearch_entry_button_press_cb (GtkWidget *widget, GdkEventFocus *f, gpointer data)
 handler for web search tool bar item button press signal More...
 
static gboolean newwindow_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for new window tool bar item clicked signal More...
 
static gboolean newtab_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for new tab tool bar item clicked signal More...
 
static gboolean openfile_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for open file tool bar item clicked signal More...
 
static gboolean closewindow_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for close window tool bar item clicked signal More...
 
static gboolean savepage_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for full save export tool bar item clicked signal More...
 
static gboolean pdf_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for pdf export tool bar item clicked signal More...
 
static gboolean plaintext_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for plain text export tool bar item clicked signal More...
 
static gboolean print_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for print tool bar item clicked signal More...
 
static gboolean quit_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for quit tool bar item clicked signal More...
 
static gboolean cut_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for cut tool bar item clicked signal More...
 
static gboolean copy_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for copy tool bar item clicked signal More...
 
static gboolean paste_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for paste tool bar item clicked signal More...
 
static gboolean delete_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for delete tool bar item clicked signal More...
 
static gboolean selectall_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for select all tool bar item clicked signal More...
 
static gboolean preferences_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for preferences tool bar item clicked signal More...
 
static gboolean zoomplus_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for zoom plus tool bar item clicked signal More...
 
static gboolean zoomminus_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for zoom minus tool bar item clicked signal More...
 
static gboolean zoomnormal_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for zoom normal tool bar item clicked signal More...
 
static gboolean fullscreen_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for full screen tool bar item clicked signal More...
 
static gboolean viewsource_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for view source tool bar item clicked signal More...
 
static gboolean downloads_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for show downloads tool bar item clicked signal More...
 
static gboolean savewindowsize_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for show downloads tool bar item clicked signal More...
 
static gboolean toggledebugging_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for show downloads tool bar item clicked signal More...
 
static gboolean debugboxtree_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for debug box tree tool bar item clicked signal More...
 
static gboolean debugdomtree_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for debug dom tree tool bar item clicked signal More...
 
static gboolean localhistory_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for local history tool bar item clicked signal More...
 
static gboolean history_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for history tool bar item clicked signal More...
 
static gboolean globalhistory_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for global history tool bar item clicked signal More...
 
static gboolean addbookmarks_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for add bookmark tool bar item clicked signal More...
 
static gboolean showbookmarks_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for show bookmark tool bar item clicked signal More...
 
static gboolean showcookies_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for show cookies tool bar item clicked signal More...
 
static gboolean openlocation_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for open location tool bar item clicked signal More...
 
static gboolean contents_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for contents tool bar item clicked signal More...
 
static gboolean guide_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for contents tool bar item clicked signal More...
 
static gboolean info_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for contents tool bar item clicked signal More...
 
static gboolean about_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for contents tool bar item clicked signal More...
 
static gboolean openmenu_button_clicked_cb (GtkWidget *widget, gpointer data)
 handler for openmenu tool bar item clicked signal More...
 
static nserror set_throbber_frame (GtkToolItem *toolbar_item, int frame)
 set a toolbar item to a throbber frame number More...
 
static void next_throbber_frame (void *p)
 Make the throbber run. More...
 
static nserror toolbar_connect_signal (struct nsgtk_toolbar *tb, nsgtk_toolbar_button itemid)
 connect signal handlers to a gtk toolbar item More...
 
static nserror toolbar_connect_signals (struct nsgtk_toolbar *tb)
 connect all signals to widgets in a toolbar More...
 
static gboolean toolbar_popup_context_menu_cb (GtkToolbar *toolbar, gint x, gint y, gint button, gpointer data)
 signal handler for toolbar context menu More...
 
static void toolbar_destroy_cb (GtkWidget *widget, gpointer data)
 toolbar delete signal handler More...
 
nserror nsgtk_toolbar_create (GtkBuilder *builder, struct browser_window *(*get_bw)(void *ctx), void *get_ctx, bool want_location_focus, struct nsgtk_toolbar **tb_out)
 create a control toolbar More...
 
nserror nsgtk_toolbar_restyle (struct nsgtk_toolbar *tb)
 Update toolbar style and size based on current settings. More...
 
nserror nsgtk_toolbar_throbber (struct nsgtk_toolbar *tb, bool active)
 Start or stop a throbber in a toolbar. More...
 
nserror nsgtk_toolbar_page_info_change (struct nsgtk_toolbar *tb)
 Page info has changed state. More...
 
nserror nsgtk_toolbar_set_url (struct nsgtk_toolbar *tb, nsurl *url)
 Update the toolbar url entry. More...
 
nserror nsgtk_toolbar_set_websearch_image (struct nsgtk_toolbar *tb, GdkPixbuf *pixbuf)
 set the websearch image More...
 
nserror nsgtk_toolbar_item_activate (struct nsgtk_toolbar *tb, nsgtk_toolbar_button itemid)
 activate the handler for a toolbar item More...
 
nserror nsgtk_toolbar_show (struct nsgtk_toolbar *tb, bool show)
 set the toolbar to be shown or hidden More...
 
nserror nsgtk_toolbar_update (struct nsgtk_toolbar *tb)
 Update the toolbar items being shown based on current settings. More...
 
static nserror nsgtk_toolbar_get_icon_window_position (struct nsgtk_toolbar *tb, int item_idx, int *out_x, int *out_y)
 Find the correct location for popping up a window for the chosen item. More...
 
nserror nsgtk_toolbar_position_page_info (struct nsgtk_toolbar *tb, struct nsgtk_pi_window *win)
 position the page info window appropriately More...
 
nserror nsgtk_toolbar_position_local_history (struct nsgtk_toolbar *tb)
 position the local history window appropriately More...
 

Variables

static GtkTargetEntry target_entry
 target entry for drag source More...
 

Detailed Description

implementation of toolbar to control browsing context

Definition in file toolbar.c.

Macro Definition Documentation

◆ INACTIVE_LOCATION

#define INACTIVE_LOCATION   (-1)

button location indicating button is not to be shown

Definition at line 78 of file toolbar.c.

◆ NSGTK_BUTTON_HEIGHT

#define NSGTK_BUTTON_HEIGHT   70

the 'standard' height of a button that fits as many toolbars as possible into the store

Definition at line 99 of file toolbar.c.

◆ NSGTK_BUTTON_WIDTH

#define NSGTK_BUTTON_WIDTH   120

the 'standard' width of a button that makes sufficient of its label visible

Definition at line 93 of file toolbar.c.

◆ NSGTK_MIN_STORE_COLUMNS

#define NSGTK_MIN_STORE_COLUMNS   4

the minimum number of columns in the tool store

Definition at line 88 of file toolbar.c.

◆ NSGTK_WEBSEARCH_WIDTH

#define NSGTK_WEBSEARCH_WIDTH   150

the 'normal' width of the websearch bar

Definition at line 104 of file toolbar.c.

◆ THROBBER_FRAME_TIME

#define THROBBER_FRAME_TIME   (100)

time (in ms) between throbber animation frame updates

Definition at line 83 of file toolbar.c.

◆ TOOLBAR_ITEM [1/4]

#define TOOLBAR_ITEM (   identifier,
  iname,
  snstvty,
  clicked,
  activate,
  label,
  iconame 
)
Value:
case identifier: \
item->name = #iname; \
item->sensitivity = snstvty; \
item->dataplus = nsgtk_toolbar_##iname##_data_plus; \
item->dataminus = nsgtk_toolbar_##iname##_data_minus; \
TOOLBAR_ITEM_ ## clicked(iname) \
break;

Definition at line 3169 of file toolbar.c.

◆ TOOLBAR_ITEM [2/4]

#define TOOLBAR_ITEM (   identifier,
  name,
  snstvty,
  clicked,
  activate,
  label,
  iconame 
)     TOOLBAR_ITEM_ ## clicked(identifier, label, iconame)

Definition at line 3169 of file toolbar.c.

◆ TOOLBAR_ITEM [3/4]

#define TOOLBAR_ITEM (   identifier,
  name,
  snstvty,
  clicked,
  activate,
  label,
  iconame 
)     TOOLBAR_ITEM_ ## clicked(identifier, label, iconame)

Definition at line 3169 of file toolbar.c.

◆ TOOLBAR_ITEM [4/4]

#define TOOLBAR_ITEM (   identifier,
  name,
  snstvty,
  clicked,
  activate,
  label,
  iconame 
)
Value:
static gboolean \
nsgtk_toolbar_##name##_data_plus(GtkWidget *widget, \
GdkDragContext *cont, \
GtkSelectionData *selection, \
guint info, \
guint time, \
gpointer data) \
{ \
tbc = (struct nsgtk_toolbar_customisation *)data; \
tbc->dragitem = identifier; \
tbc->dragfrom = true; \
return TRUE; \
} \
static gboolean \
nsgtk_toolbar_##name##_data_minus(GtkWidget *widget, \
GdkDragContext *cont, \
GtkSelectionData *selection, \
guint info, \
guint time, \
gpointer data) \
{ \
tbc = (struct nsgtk_toolbar_customisation *)data; \
tbc->dragitem = identifier; \
tbc->dragfrom = false; \
return TRUE; \
}
toolbar cusomisation context
Definition: toolbar.c:215
int dragitem
which item is being dragged
Definition: toolbar.c:240

Definition at line 3169 of file toolbar.c.

◆ TOOLBAR_ITEM_b [1/3]

#define TOOLBAR_ITEM_b (   identifier,
  label,
  iconame 
)
Value:
case identifier: \
toolitem = make_toolbar_item_button(#label, iconame, sensitivity, false); \
break;
static GtkToolItem * make_toolbar_item_button(const char *labelmsg, const char *iconname, bool sensitivity, bool edit)
create generic button toolbar item widget
Definition: toolbar.c:465

◆ TOOLBAR_ITEM_b [2/3]

#define TOOLBAR_ITEM_b (   identifier,
  label,
  iconame 
)
Value:
case identifier: \
toolitem = make_toolbar_item_button(#label, iconame, true, true); \
break;

◆ TOOLBAR_ITEM_b [3/3]

#define TOOLBAR_ITEM_b (   name)     item->clicked = name##_button_clicked_cb;

◆ TOOLBAR_ITEM_n [1/3]

#define TOOLBAR_ITEM_n (   identifier,
  label,
  iconame 
)

◆ TOOLBAR_ITEM_n [2/3]

#define TOOLBAR_ITEM_n (   identifier,
  label,
  iconame 
)

◆ TOOLBAR_ITEM_n [3/3]

#define TOOLBAR_ITEM_n (   name)     item->clicked = NULL;

◆ TOOLBAR_ITEM_t [1/3]

#define TOOLBAR_ITEM_t (   identifier,
  label,
  iconame 
)
Value:
case identifier: \
toolitem = make_toolbar_item_button(#label, iconame, sensitivity, false); \
break;

◆ TOOLBAR_ITEM_t [2/3]

#define TOOLBAR_ITEM_t (   identifier,
  label,
  iconame 
)
Value:
case identifier: \
if (bar) { \
toolitem = make_toolbar_item_button(#label, iconame, true, true); \
} \
break;

◆ TOOLBAR_ITEM_t [3/3]

#define TOOLBAR_ITEM_t (   name)     item->clicked = name##_button_clicked_cb;

◆ TOOLBAR_ITEM_y [1/3]

#define TOOLBAR_ITEM_y (   identifier,
  label,
  iconame 
)

◆ TOOLBAR_ITEM_y [2/3]

#define TOOLBAR_ITEM_y (   identifier,
  label,
  iconame 
)

◆ TOOLBAR_ITEM_y [3/3]

#define TOOLBAR_ITEM_y (   name)     item->clicked = name##_button_clicked_cb;

Enumeration Type Documentation

◆ nsgtk_toolbar_location_focus_state

Location focus state machine.

  1. If we don't care, we're in LFS_IDLE
  2. When we create a new toolbar, we can put it into LFS_WANT which means that we want the url bar to focus
  3. When we start throbbing if we're in LFS_WANT we move to LFS_THROB
  4. When we stop throbbing, if we're in LFS_THROB we move to LFS_LAST

While not in LFS_IDLE, if the url bar is updated and we previously had it fully selected then we reselect it all. If we're in LFS_LAST we move to LFS_IDLE at that point.

Enumerator
LFS_IDLE 

Nothing to do.

LFS_WANT 

Want focus, will apply.

LFS_THROB 

Want focus, we have started throbbing.

LFS_LAST 

Last chance for a focus update.

Definition at line 160 of file toolbar.c.

Function Documentation

◆ about_button_clicked_cb()

static gboolean about_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for contents tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 3135 of file toolbar.c.

References nsgtk_about_dialog_init(), parent, and nsgtk_toolbar::widget.

Here is the call graph for this function:

◆ add_toolbox_row()

static nserror add_toolbox_row ( struct nsgtk_toolbar_customisation tbc,
int  startitem,
int  enditem 
)
static

add a row to a toolbar customisation toolbox

Parameters
tbcThe toolbar customisation context
startitemThe item index of the beginning of the row
enditemThe item index of the beginning of the next row
Returns
NSERROR_OK on successs else error

Definition at line 1397 of file toolbar.c.

References nsgtk_toolbar_item::dataplus, item_size_allocate_cb(), nsgtk_toolbar::items, nsgtk_toolbar_customisation::items, NSERROR_NOMEM, NSERROR_OK, NSGTK_BUTTON_HEIGHT, NSGTK_BUTTON_WIDTH, target_entry, nsgtk_toolbar_customisation::toolbar, and nsgtk_toolbar_customisation::toolbox.

Referenced by toolbar_customisation_create_toolbox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addbookmarks_button_clicked_cb()

static gboolean addbookmarks_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for add bookmark tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2989 of file toolbar.c.

References browser_window_access_url(), browser_window_has_content(), browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, and hotlist_add_url().

Here is the call graph for this function:

◆ apply_user_button_customisation()

static nserror apply_user_button_customisation ( struct nsgtk_toolbar tb)
static

Apply the user toolbar button settings from configuration.

GTK specific user option string is a set of fields arranged as [itemreference];[itemlocation]|[itemreference];[itemlocation]| etc

Parameters
tbThe toolbar to apply customisation to
NSERROR_OKon success else error code.

Definition at line 998 of file toolbar.c.

References BACK_BUTTON, FORWARD_BUTTON, HISTORY_BUTTON, INACTIVE_LOCATION, nsgtk_toolbar::items, nsgtk_toolbar_item::location, nsgtk_toolbar_item::name, NSERROR_OK, nsoption_charp, OPENMENU_BUTTON, PLACEHOLDER_BUTTON, RELOADSTOP_BUTTON, THROBBER_ITEM, URL_BAR_ITEM, and WEBSEARCH_ITEM.

Referenced by customisation_toolbar_update(), and nsgtk_toolbar_update().

Here is the caller graph for this function:

◆ back_button_clicked_cb()

static gboolean back_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for back tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 1777 of file toolbar.c.

References BACK_BUTTON, browser_window_history_back(), browser_window_history_back_available(), browser_window_history_forward_available(), browser_window_search_clear(), browser_window::bw, FORWARD_BUTTON, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, nsgtk_toolbar::items, nsgtk_local_history_hide(), and set_item_sensitivity().

Here is the call graph for this function:

◆ closewindow_button_clicked_cb()

static gboolean closewindow_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for close window tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2187 of file toolbar.c.

◆ container_remove_widget()

static void container_remove_widget ( GtkWidget *  widget,
gpointer  data 
)
static

callback function to remove a widget from a container

Definition at line 1056 of file toolbar.c.

References nsgtk_toolbar::widget.

Referenced by customisation_toolbar_populate(), and populate_gtk_toolbar_widget().

Here is the caller graph for this function:

◆ contents_button_clicked_cb()

static gboolean contents_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for contents tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 3071 of file toolbar.c.

References messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), and toolbar_navigate_to_url().

Here is the call graph for this function:

◆ copy_button_clicked_cb()

static gboolean copy_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for copy tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2491 of file toolbar.c.

References browser_window_key_press(), browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, and NS_KEY_COPY_SELECTION.

Here is the call graph for this function:

◆ customisation_apply_clicked_cb()

static gboolean customisation_apply_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

customisation apply handler for clicked signal

when 'save settings' button is clicked

Definition at line 1524 of file toolbar.c.

References nsgtk_toolbar_customisation::container, nsgtk_toolbar_customisation_save(), nsgtk_window_toolbar_update(), and nsgtk_toolbar_customisation::toolbar.

Referenced by cutomize_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ customisation_container_destroy_cb()

static void customisation_container_destroy_cb ( GtkWidget *  widget,
gpointer  data 
)
static

customisation container destroy handler

Definition at line 1558 of file toolbar.c.

Referenced by cutomize_button_clicked_cb().

Here is the caller graph for this function:

◆ customisation_container_drag_drop_cb()

static gboolean customisation_container_drag_drop_cb ( GtkWidget *  widget,
GdkDragContext *  gdc,
gint  x,
gint  y,
guint  time,
gpointer  data 
)
static

customisation container handler for drag drop signal

called when a widget is dropped onto the store window

Definition at line 744 of file toolbar.c.

References nsgtk_toolbar_item::button, nsgtk_toolbar_customisation::dragfrom, nsgtk_toolbar_customisation::dragitem, INACTIVE_LOCATION, itemid_from_location(), nsgtk_toolbar::items, nsgtk_toolbar_item::location, PLACEHOLDER_BUTTON, nsgtk_toolbar_customisation::toolbar, and nsgtk_toolbar::widget.

Referenced by cutomize_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ customisation_container_drag_motion_cb()

static gboolean customisation_container_drag_motion_cb ( GtkWidget *  widget,
GdkDragContext *  gdc,
gint  x,
gint  y,
guint  time,
gpointer  data 
)
static

customisation container handler for drag motion signal

called when hovering above the store

Definition at line 795 of file toolbar.c.

Referenced by cutomize_button_clicked_cb().

Here is the caller graph for this function:

◆ customisation_reset_clicked_cb()

static gboolean customisation_reset_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

customisation reset handler for clicked signal

when 'reload defaults' button is clicked

Definition at line 1544 of file toolbar.c.

References customisation_toolbar_update().

Referenced by cutomize_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ customisation_toolbar_drag_data_received_cb()

static gboolean customisation_toolbar_drag_data_received_cb ( GtkWidget *  widget,
GdkDragContext *  gdc,
gint  x,
gint  y,
GtkSelectionData *  selection,
guint  info,
guint  time,
gpointer  data 
)
static

customisation toolbar handler for drag data received signal

connected to toolbutton drop; perhaps one day it'll work properly so it may replace the global current_button

Definition at line 891 of file toolbar.c.

Referenced by toolbar_customisation_connect_signals().

Here is the caller graph for this function:

◆ customisation_toolbar_drag_drop_cb()

static gboolean customisation_toolbar_drag_drop_cb ( GtkWidget *  widget,
GdkDragContext *  gdc,
gint  x,
gint  y,
guint  time,
gpointer  data 
)
static

customisation toolbar handler for drag drop signal

called when a widget is dropped onto the toolbar

Definition at line 811 of file toolbar.c.

References nsgtk_toolbar_item::button, nsgtk_toolbar_customisation::dragitem, INACTIVE_LOCATION, itemid_from_location(), nsgtk_toolbar::items, nsgtk_toolbar_item::location, make_toolbox_item(), nsgtk_warning(), PLACEHOLDER_BUTTON, nsgtk_toolbar_customisation::toolbar, toolbar_item_connect_signals(), and nsgtk_toolbar::widget.

Referenced by toolbar_customisation_connect_signals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ customisation_toolbar_drag_leave_cb()

static void customisation_toolbar_drag_leave_cb ( GtkWidget *  widget,
GdkDragContext *  gdc,
guint  time,
gpointer  data 
)
static

customisation toolbar handler for drag leave signal

called when hovering stops

Definition at line 936 of file toolbar.c.

References nsgtk_toolbar::widget.

Referenced by toolbar_customisation_connect_signals().

Here is the caller graph for this function:

◆ customisation_toolbar_drag_motion_cb()

static gboolean customisation_toolbar_drag_motion_cb ( GtkWidget *  widget,
GdkDragContext *  gdc,
gint  x,
gint  y,
guint  time,
gpointer  data 
)
static

customisation toolbar handler for drag motion signal

called when hovering an item above the toolbar

Definition at line 910 of file toolbar.c.

References nsgtk_toolbar::widget.

Referenced by toolbar_customisation_connect_signals().

Here is the caller graph for this function:

◆ customisation_toolbar_populate()

static nserror customisation_toolbar_populate ( struct nsgtk_toolbar tb)
static

populates the customization toolbar with widgets in correct order

Parameters
tbtoolbar
Returns
NSERROR_OK on success else error code.

Definition at line 1106 of file toolbar.c.

References nsgtk_toolbar_item::button, container_remove_widget(), itemid_from_location(), nsgtk_toolbar::items, make_toolbox_item(), NSERROR_OK, PLACEHOLDER_BUTTON, and nsgtk_toolbar::widget.

Referenced by customisation_toolbar_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ customisation_toolbar_update()

static nserror customisation_toolbar_update ( struct nsgtk_toolbar_customisation tbc)
static

update toolbar in customisation to user settings

Definition at line 1487 of file toolbar.c.

References apply_user_button_customisation(), customisation_toolbar_populate(), NSERROR_OK, nsgtk_toolbar_restyle(), nsgtk_toolbar_customisation::toolbar, and toolbar_customisation_connect_signals().

Referenced by customisation_reset_clicked_cb(), and cutomize_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cut_button_clicked_cb()

static gboolean cut_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for cut tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2460 of file toolbar.c.

References browser_window_key_press(), browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, and NS_KEY_CUT_SELECTION.

Here is the call graph for this function:

◆ cutomize_button_clicked_cb()

static gboolean cutomize_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

create a toolbar customisation tab

this is completely different approach to previous implementation. it is not modal and the toolbar configuration is performed completely within the tab. once the user is happy they can apply the change or cancel as they see fit while continuing to use the browser as usual.

Definition at line 1578 of file toolbar.c.

References BACK_BUTTON, nsgtk_toolbar_customisation::container, customisation_apply_clicked_cb(), customisation_container_destroy_cb(), customisation_container_drag_drop_cb(), customisation_container_drag_motion_cb(), customisation_reset_clicked_cb(), customisation_toolbar_update(), favicon_pixbuf, nsgtk_toolbar::items, messages_get(), NSERROR_OK, nsgtk_builder_new_from_resname(), nsgtk_tab_add_page(), NSLOG, PLACEHOLDER_BUTTON, target_entry, nsgtk_toolbar_customisation::toolbar, toolbar_customisation_create_toolbox(), toolbar_item_create(), nsgtk_toolbar_customisation::toolbox, and nsgtk_toolbar::widget.

Here is the call graph for this function:

◆ debugboxtree_button_clicked_cb()

static gboolean debugboxtree_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for debug box tree tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2836 of file toolbar.c.

References browser_window_debug_dump(), browser_window::bw, CONTENT_DEBUG_RENDER, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, nsgtk_viewfile(), and nsgtk_warning().

Here is the call graph for this function:

◆ debugdomtree_button_clicked_cb()

static gboolean debugdomtree_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for debug dom tree tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2881 of file toolbar.c.

References browser_window_debug_dump(), browser_window::bw, CONTENT_DEBUG_DOM, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, nsgtk_viewfile(), and nsgtk_warning().

Here is the call graph for this function:

◆ delete_button_clicked_cb()

static gboolean delete_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for delete tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2553 of file toolbar.c.

References browser_window_key_press(), browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, and NS_KEY_CLEAR_SELECTION.

Here is the call graph for this function:

◆ downloads_button_clicked_cb()

static gboolean downloads_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for show downloads tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2762 of file toolbar.c.

References nsgtk_download_show().

Here is the call graph for this function:

◆ forward_button_clicked_cb()

static gboolean forward_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for forward tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 1809 of file toolbar.c.

References BACK_BUTTON, browser_window_history_back_available(), browser_window_history_forward(), browser_window_history_forward_available(), browser_window_search_clear(), browser_window::bw, FORWARD_BUTTON, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, nsgtk_toolbar::items, nsgtk_local_history_hide(), and set_item_sensitivity().

Here is the call graph for this function:

◆ fullscreen_button_clicked_cb()

static gboolean fullscreen_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for full screen tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2707 of file toolbar.c.

◆ globalhistory_button_clicked_cb()

static gboolean globalhistory_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for global history tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2969 of file toolbar.c.

References NSERROR_OK, nsgtk_global_history_present(), and NSLOG.

Here is the call graph for this function:

◆ guide_button_clicked_cb()

static gboolean guide_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for contents tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 3092 of file toolbar.c.

References messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), and toolbar_navigate_to_url().

Here is the call graph for this function:

◆ history_button_clicked_cb()

static gboolean history_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for history tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2955 of file toolbar.c.

References localhistory_button_clicked_cb().

Here is the call graph for this function:

◆ home_button_clicked_cb()

static gboolean home_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for home tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 1910 of file toolbar.c.

References messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), nsoption_charp, and toolbar_navigate_to_url().

Here is the call graph for this function:

◆ info_button_clicked_cb()

static gboolean info_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for contents tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 3114 of file toolbar.c.

References messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), and toolbar_navigate_to_url().

Here is the call graph for this function:

◆ item_size_allocate_cb()

static void item_size_allocate_cb ( GtkWidget *  widget,
GdkRectangle *  alloc,
gpointer  user_data 
)
static

Definition at line 1374 of file toolbar.c.

References NSGTK_BUTTON_HEIGHT, and NSGTK_BUTTON_WIDTH.

Referenced by add_toolbox_row().

Here is the caller graph for this function:

◆ itemid_from_gtktoolitem()

static nsgtk_toolbar_button itemid_from_gtktoolitem ( struct nsgtk_toolbar tb,
GtkToolItem *  toolitem 
)
static

find the toolbar item with a given gtk widget.

Parameters
tbthe toolbar instance
toolitemthe tool item widget to search for
Returns
the item id matching the widget

Definition at line 1143 of file toolbar.c.

References BACK_BUTTON, nsgtk_toolbar_item::button, INACTIVE_LOCATION, nsgtk_toolbar::items, nsgtk_toolbar_item::location, and PLACEHOLDER_BUTTON.

Referenced by toolbar_item_size_allocate_cb().

Here is the caller graph for this function:

◆ itemid_from_location()

static nsgtk_toolbar_button itemid_from_location ( struct nsgtk_toolbar tb,
int  location 
)
static

find the toolbar item with a given location.

Parameters
tbthe toolbar instance
locactionthe location to search for
Returns
the item id for a location

Definition at line 628 of file toolbar.c.

References BACK_BUTTON, nsgtk_toolbar::items, nsgtk_toolbar_item::location, and PLACEHOLDER_BUTTON.

Referenced by customisation_container_drag_drop_cb(), customisation_toolbar_drag_drop_cb(), customisation_toolbar_populate(), nsgtk_toolbar_customisation_save(), populate_gtk_toolbar_widget(), and toolbar_connect_signals().

Here is the caller graph for this function:

◆ localhistory_button_clicked_cb()

static gboolean localhistory_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for local history tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2927 of file toolbar.c.

References browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, NSERROR_OK, nsgtk_local_history_present(), and NSLOG.

Referenced by history_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_toolbar_item()

static GtkToolItem * make_toolbar_item ( nsgtk_toolbar_button  itemid,
bool  sensitivity 
)
static

widget factory for creation of toolbar item widgets

Parameters
ithe id of the widget
themethe theme to make the widgets from
Returns
gtk widget

Definition at line 501 of file toolbar.c.

References HISTORY_BUTTON, make_toolbar_item_history(), make_toolbar_item_throbber(), make_toolbar_item_url_bar(), make_toolbar_item_websearch(), THROBBER_ITEM, URL_BAR_ITEM, and WEBSEARCH_ITEM.

Referenced by populate_gtk_toolbar_widget().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_toolbar_item_button()

static GtkToolItem * make_toolbar_item_button ( const char *  labelmsg,
const char *  iconname,
bool  sensitivity,
bool  edit 
)
static

create generic button toolbar item widget

Definition at line 465 of file toolbar.c.

References messages_get(), nsgtk_widget_set_margins(), and remove_underscores().

Here is the call graph for this function:

◆ make_toolbar_item_history()

static GtkToolItem * make_toolbar_item_history ( bool  sensitivity,
bool  edit 
)
static

create local history toolbar item widget

Definition at line 437 of file toolbar.c.

References messages_get(), and remove_underscores().

Referenced by make_toolbar_item(), and make_toolbox_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_toolbar_item_throbber()

static GtkToolItem * make_toolbar_item_throbber ( bool  sensitivity,
bool  edit 
)
static

create throbber toolbar item widget

create a gtk entry widget with a completion attached

Definition at line 288 of file toolbar.c.

References GTK_ALIGN_CENTER, messages_get(), NSERROR_OK, nsgtk_throbber_get_frame(), nsgtk_widget_set_alignment(), and nsgtk_widget_set_margins().

Referenced by make_toolbar_item(), and make_toolbox_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_toolbar_item_url_bar()

static GtkToolItem * make_toolbar_item_url_bar ( bool  sensitivity,
bool  edit 
)
static

create url bar toolbar item widget

create a gtk entry widget with a completion attached

Parameters
sensitivityif the entry should be created sensitive to input
editif the entry should be editable

Definition at line 334 of file toolbar.c.

References GTK_ENTRY_ICON_PRIMARY, nsgtk_entry_new(), and nsgtk_entry_set_icon_from_icon_name().

Referenced by make_toolbar_item(), and make_toolbox_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_toolbar_item_websearch()

static GtkToolItem * make_toolbar_item_websearch ( bool  sensitivity,
bool  edit 
)
static

create web search toolbar item widget

Definition at line 380 of file toolbar.c.

References bitmap(), GTK_ENTRY_ICON_PRIMARY, NSERROR_OK, nsgdk_pixbuf_get_from_surface(), nsgtk_entry_new(), nsgtk_entry_set_icon_from_icon_name(), nsgtk_entry_set_icon_from_pixbuf(), NSGTK_STOCK_INFO, NSGTK_WEBSEARCH_WIDTH, search_web_get_provider_bitmap(), and bitmap::surface.

Referenced by make_toolbar_item(), and make_toolbox_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_toolbox_item()

static GtkToolItem * make_toolbox_item ( nsgtk_toolbar_button  itemid,
bool  bar 
)
static

widget factory for creation of toolbar item widgets for the toolbox

Parameters
itemidthe id of the widget
Returns
gtk tool item widget

Definition at line 558 of file toolbar.c.

References HISTORY_BUTTON, make_toolbar_item_history(), make_toolbar_item_throbber(), make_toolbar_item_url_bar(), make_toolbar_item_websearch(), THROBBER_ITEM, URL_BAR_ITEM, and WEBSEARCH_ITEM.

Referenced by customisation_toolbar_drag_drop_cb(), customisation_toolbar_populate(), and toolbar_customisation_create_toolbox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newtab_button_clicked_cb()

static gboolean newtab_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for new tab tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2100 of file toolbar.c.

References nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, messages_get_errorcode(), NSERROR_OK, nsgtk_browser_window_create(), and nsgtk_warning().

Here is the call graph for this function:

◆ newwindow_button_clicked_cb()

static gboolean newwindow_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for new window tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2078 of file toolbar.c.

References nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, messages_get_errorcode(), NSERROR_OK, nsgtk_browser_window_create(), and nsgtk_warning().

Here is the call graph for this function:

◆ next_throbber_frame()

static void next_throbber_frame ( void *  p)
static

Make the throbber run.

scheduled callback to update the throbber

Parameters
pThe context passed when scheduled.

Definition at line 3288 of file toolbar.c.

References nsgtk_toolbar_item::button, nsgtk_toolbar::items, next_throbber_frame(), NSERROR_BAD_SIZE, NSERROR_OK, nsgtk_schedule(), set_throbber_frame(), nsgtk_toolbar::throb_frame, THROBBER_FRAME_TIME, and THROBBER_ITEM.

Referenced by next_throbber_frame(), nsgtk_toolbar_throbber(), and toolbar_destroy_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_browser_window_create()

static nserror nsgtk_browser_window_create ( struct browser_window bw,
bool  intab 
)
static

create a new browser window

creates a browser window with default url depending on user choices.

Parameters
bwThe browser window to pass for existing window/
intabtrue if the new window should be in a tab else false for new window.
Returns
NSERROR_OK on success else error code.

Definition at line 956 of file toolbar.c.

References browser_window_create(), BW_CREATE_FOCUS_LOCATION, BW_CREATE_FOREGROUND, BW_CREATE_HISTORY, BW_CREATE_TAB, NSERROR_OK, nsoption_bool, nsoption_charp, nsurl_create(), and nsurl_unref().

Referenced by newtab_button_clicked_cb(), and newwindow_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_saveas_dialog()

static nserror nsgtk_saveas_dialog ( struct browser_window bw,
const char *  title,
GtkWindow *  parent,
bool  folder,
gchar **  path_out 
)
static

run a gtk file chooser as a save dialog to obtain a path

Definition at line 1266 of file toolbar.c.

References browser_window_access_url(), browser_window_has_content(), browser_window::bw, messages_get(), NSERROR_INVALID, NSERROR_NOMEM, NSERROR_NOT_FOUND, NSERROR_OK, NSGTK_STOCK_CANCEL, NSGTK_STOCK_SAVE, nsurl_nice(), parent, and path().

Referenced by pdf_button_clicked_cb(), plaintext_button_clicked_cb(), and savepage_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_toolbar_create()

nserror nsgtk_toolbar_create ( GtkBuilder *  builder,
struct browser_window *(*)(void *ctx)  get_bw,
void *  get_bw_ctx,
bool  want_location_focus,
struct nsgtk_toolbar **  toolbar 
)

create a control toolbar

Parameters
[in]builderThe gtk builder object the toolbar is being created from
[out]toolbara pointer to receive the result.
Returns
NSERROR_OK and toolbar updated on success else error code

Definition at line 3447 of file toolbar.c.

References BACK_BUTTON, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, nsgtk_toolbar::items, LFS_IDLE, LFS_WANT, nsgtk_toolbar::loc_focus, NSERROR_NOMEM, NSERROR_OK, nsgtk_toolbar_update(), PLACEHOLDER_BUTTON, nsgtk_toolbar::throb_frame, toolbar_destroy_cb(), toolbar_item_create(), toolbar_popup_context_menu_cb(), and nsgtk_toolbar::widget.

Referenced by gui_window_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_toolbar_customisation_save()

static nserror nsgtk_toolbar_customisation_save ( struct nsgtk_toolbar tb)
static

save toolbar settings to file

Definition at line 644 of file toolbar.c.

References BACK_BUTTON, INACTIVE_LOCATION, itemid_from_location(), nsgtk_toolbar::items, nsgtk_toolbar_item::location, nsgtk_toolbar_item::name, netsurf_mkpath(), NSERROR_INVALID, NSERROR_NOMEM, NSERROR_OK, NSERROR_UNKNOWN, nsgtk_config_home, nsoption_set_charp, nsoption_write(), and PLACEHOLDER_BUTTON.

Referenced by customisation_apply_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_toolbar_get_icon_window_position()

static nserror nsgtk_toolbar_get_icon_window_position ( struct nsgtk_toolbar tb,
int  item_idx,
int *  out_x,
int *  out_y 
)
static

Find the correct location for popping up a window for the chosen item.

Parameters
tbThe toolbar to select from
item_idxThe toolbar item to select from
out_xFilled with an appropriate X coordinate
out_yFilled with an appropriate Y coordinate

Definition at line 3819 of file toolbar.c.

References nsgtk_toolbar_item::button, nsgtk_toolbar::items, NSERROR_OK, NSERROR_UNKNOWN, nsgtk_widget_get_allocation(), and URL_BAR_ITEM.

Referenced by nsgtk_toolbar_position_local_history(), and nsgtk_toolbar_position_page_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_toolbar_item_activate()

nserror nsgtk_toolbar_item_activate ( struct nsgtk_toolbar tb,
nsgtk_toolbar_button  itemid 
)

activate the handler for a toolbar item

This allows the same action to be performed for menu enties as if the user had clicked the toolbar widget.

Parameters
toolbarA toolbar returned from a creation
itemidthe id of the item to activate
Returns
NSERROR_OK on success

Definition at line 3740 of file toolbar.c.

References BACK_BUTTON, nsgtk_toolbar_item::button, nsgtk_toolbar_item::clicked, nsgtk_toolbar::items, NSERROR_BAD_PARAMETER, NSERROR_INVALID, NSERROR_OK, PLACEHOLDER_BUTTON, and nsgtk_toolbar::widget.

Referenced by nsgtk_window_button_release_event(), and nsgtk_window_item_activate().

Here is the caller graph for this function:

◆ nsgtk_toolbar_page_info_change()

nserror nsgtk_toolbar_page_info_change ( struct nsgtk_toolbar tb)

Page info has changed state.

Parameters
toolbarA toolbar returned from a creation
Returns
NSERROR_OK on success

Definition at line 3607 of file toolbar.c.

References browser_window_get_page_info_state(), nsgtk_toolbar_item::button, browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, GTK_ENTRY_ICON_PRIMARY, nsgtk_toolbar::items, NSERROR_INVALID, NSERROR_OK, nsgtk_entry_set_icon_from_icon_name(), PAGE_STATE_INSECURE, PAGE_STATE_INTERNAL, PAGE_STATE_LOCAL, PAGE_STATE_SECURE, PAGE_STATE_SECURE_ISSUES, PAGE_STATE_SECURE_OVERRIDE, and URL_BAR_ITEM.

Referenced by page_info_change().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_toolbar_position_local_history()

nserror nsgtk_toolbar_position_local_history ( struct nsgtk_toolbar tb)

position the local history window appropriately

Parameters
tbThe toolbar to position relative to

Definition at line 3874 of file toolbar.c.

References HISTORY_BUTTON, NSERROR_OK, nsgtk_local_history_set_position(), and nsgtk_toolbar_get_icon_window_position().

Referenced by nsgtk_window_position_local_history().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_toolbar_position_page_info()

nserror nsgtk_toolbar_position_page_info ( struct nsgtk_toolbar tb,
struct nsgtk_pi_window win 
)

position the page info window appropriately

Parameters
tbThe toolbar to position relative to
winThe page-info window to position

Definition at line 3857 of file toolbar.c.

References NSERROR_OK, nsgtk_page_info_set_position(), nsgtk_toolbar_get_icon_window_position(), and URL_BAR_ITEM.

Referenced by nsgtk_window_position_page_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_toolbar_restyle()

nserror nsgtk_toolbar_restyle ( struct nsgtk_toolbar tb)

Update toolbar style and size based on current settings.

Parameters
toolbarA toolbar returned from a creation
Returns
NSERROR_OK on success

Definition at line 3505 of file toolbar.c.

References NSERROR_OK, nsoption_int, nsgtk_toolbar::offset, and nsgtk_toolbar::widget.

Referenced by customisation_toolbar_update(), nsgtk_toolbar_update(), and nsgtk_window_update_all().

Here is the caller graph for this function:

◆ nsgtk_toolbar_set_url()

nserror nsgtk_toolbar_set_url ( struct nsgtk_toolbar tb,
nsurl url 
)

Update the toolbar url entry.

Parameters
toolbarA toolbar returned from a creation
urlThe URL to set
Returns
NSERROR_OK on success

Definition at line 3662 of file toolbar.c.

References nsgtk_toolbar_item::button, nsgtk_toolbar::items, LFS_IDLE, LFS_LAST, nsgtk_toolbar::loc_focus, NSERROR_INVALID, NSERROR_OK, nsoption_bool, nsurl_access(), nsurl_get_utf8(), and URL_BAR_ITEM.

Referenced by gui_window_set_url().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_toolbar_set_websearch_image()

nserror nsgtk_toolbar_set_websearch_image ( struct nsgtk_toolbar tb,
GdkPixbuf *  pixbuf 
)

set the websearch image

Parameters
toolbarA toolbar returned from a creation
pixbufThe pixel buffer data to use to set the web search icon
Returns
NSERROR_OK on success

Definition at line 3713 of file toolbar.c.

References nsgtk_toolbar_item::button, GTK_ENTRY_ICON_PRIMARY, nsgtk_toolbar::items, NSERROR_INVALID, NSERROR_OK, nsgtk_entry_set_icon_from_icon_name(), nsgtk_entry_set_icon_from_pixbuf(), NSGTK_STOCK_INFO, and WEBSEARCH_ITEM.

Referenced by gui_search_web_provider_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_toolbar_show()

nserror nsgtk_toolbar_show ( struct nsgtk_toolbar tb,
bool  show 
)

set the toolbar to be shown or hidden

Parameters
toolbarA toolbar returned from a creation
showtrue to show the toolbar and false to hide it.
Returns
NSERROR_OK on success

Definition at line 3771 of file toolbar.c.

References NSERROR_OK, and nsgtk_toolbar::widget.

Referenced by gui_window_create(), and nsgtk_window_toolbar_show().

Here is the caller graph for this function:

◆ nsgtk_toolbar_throbber()

nserror nsgtk_toolbar_throbber ( struct nsgtk_toolbar tb,
bool  active 
)

Start or stop a throbber in a toolbar.

Parameters
toolbarA toolbar returned from a creation
activeTrue if the throbber animation should play.
Returns
NSERROR_OK on success

Definition at line 3550 of file toolbar.c.

References BACK_BUTTON, browser_window_history_back_available(), browser_window_history_forward_available(), nsgtk_toolbar_item::button, browser_window::bw, FORWARD_BUTTON, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, nsgtk_toolbar::items, LFS_IDLE, LFS_LAST, LFS_THROB, LFS_WANT, nsgtk_toolbar::loc_focus, next_throbber_frame(), NSERROR_OK, nsgtk_local_history_hide(), nsgtk_schedule(), RELOAD_BUTTON, RELOADSTOP_BUTTON, set_item_action(), set_item_sensitivity(), set_throbber_frame(), STOP_BUTTON, nsgtk_toolbar::throb_frame, THROBBER_FRAME_TIME, and THROBBER_ITEM.

Referenced by throbber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_toolbar_update()

nserror nsgtk_toolbar_update ( struct nsgtk_toolbar tb)

Update the toolbar items being shown based on current settings.

Parameters
toolbarA toolbar returned from a creation
Returns
NSERROR_OK on success

Definition at line 3783 of file toolbar.c.

References apply_user_button_customisation(), NSERROR_OK, nsgtk_toolbar_restyle(), populate_gtk_toolbar_widget(), and toolbar_connect_signals().

Referenced by nsgtk_toolbar_create(), and nsgtk_window_toolbar_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openfile_button_clicked_cb()

static gboolean openfile_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for open file tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2121 of file toolbar.c.

References browser_window_navigate(), browser_window::bw, BW_NAVIGATE_HISTORY, FILE_SCHEME_PREFIX, FILE_SCHEME_PREFIX_LEN, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, messages_get_errorcode(), NSERROR_OK, NSGTK_STOCK_CANCEL, NSGTK_STOCK_OPEN, nsgtk_warning(), nsurl_create(), and nsurl_unref().

Here is the call graph for this function:

◆ openlocation_button_clicked_cb()

static gboolean openlocation_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for open location tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 3048 of file toolbar.c.

References nsgtk_toolbar_item::button, nsgtk_toolbar::items, and URL_BAR_ITEM.

◆ openmenu_button_clicked_cb()

static gboolean openmenu_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for openmenu tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE to indicate signal handled.
Todo:
stop assuming the context is a gui window

Definition at line 3152 of file toolbar.c.

References nsgtk_toolbar::get_ctx, nsgtk_get_scaffold(), and nsgtk_scaffolding_burger_menu().

Here is the call graph for this function:

◆ paste_button_clicked_cb()

static gboolean paste_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for paste tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2522 of file toolbar.c.

References browser_window_key_press(), browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, and NS_KEY_PASTE.

Here is the call graph for this function:

◆ pdf_button_clicked_cb()

static gboolean pdf_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for pdf export tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2256 of file toolbar.c.

References browser_window_get_content(), browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, haru_nsfont, haru_nsfont_set_scale(), NSERROR_OK, nsgtk_saveas_dialog(), pdf_printer, print_basic_run(), print_make_settings(), PRINT_OPTIONS, and settings.

Here is the call graph for this function:

◆ plaintext_button_clicked_cb()

static gboolean plaintext_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for plain text export tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2308 of file toolbar.c.

References browser_window_get_content(), browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, messages_get(), NSERROR_OK, nsgtk_saveas_dialog(), and save_as_text().

Here is the call graph for this function:

◆ populate_gtk_toolbar_widget()

static nserror populate_gtk_toolbar_widget ( struct nsgtk_toolbar tb)
static

populates a toolbar with widgets in correct order

Parameters
tbtoolbar
Returns
NSERROR_OK on success else error code.

Definition at line 1069 of file toolbar.c.

References nsgtk_toolbar_item::button, container_remove_widget(), itemid_from_location(), nsgtk_toolbar::items, make_toolbar_item(), NSERROR_OK, PLACEHOLDER_BUTTON, nsgtk_toolbar_item::sensitivity, and nsgtk_toolbar::widget.

Referenced by nsgtk_toolbar_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ preferences_button_clicked_cb()

static gboolean preferences_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for preferences tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2615 of file toolbar.c.

References browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, and nsgtk_preferences().

Here is the call graph for this function:

◆ print_button_clicked_cb()

static gboolean print_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for print tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2345 of file toolbar.c.

References browser_window_get_content(), browser_window::bw, content_get_type(), CONTENT_TEXTPLAIN, content_to_print, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, gtk_print_signal_begin_print(), gtk_print_signal_draw_page(), gtk_print_signal_end_print(), messages_get(), netsurf_mkpath(), nsgtk_config_home, nsgtk_layout_table, nsgtk_warning(), PRINT_DEFAULT, and print_make_settings().

Here is the call graph for this function:

◆ quit_button_clicked_cb()

static gboolean quit_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for quit tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2445 of file toolbar.c.

References nsgtk_scaffolding_destroy_all().

Here is the call graph for this function:

◆ reload_button_clicked_cb()

static gboolean reload_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for reload tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 1858 of file toolbar.c.

References browser_window_reload(), browser_window_search_clear(), browser_window::bw, nsgtk_toolbar::get_bw, and nsgtk_toolbar::get_ctx.

Here is the call graph for this function:

◆ reloadstop_button_clicked_cb()

static gboolean reloadstop_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for reload/stop tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 1882 of file toolbar.c.

References browser_window_reload(), browser_window_search_clear(), browser_window_stop(), browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, nsgtk_toolbar::items, RELOADSTOP_BUTTON, and nsgtk_toolbar_item::sensitivity.

Here is the call graph for this function:

◆ remove_underscores()

static char * remove_underscores ( const char *  s,
bool  replacespace 
)
static

returns a string without its underscores

Parameters
sThe string to change.
replacespacetrue to insert a space where there was an underscore
Returns
The altered string

Definition at line 261 of file toolbar.c.

Referenced by make_toolbar_item_button(), make_toolbar_item_history(), and set_item_action().

Here is the caller graph for this function:

◆ savepage_button_clicked_cb()

static gboolean savepage_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for full save export tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2204 of file toolbar.c.

References browser_window_get_content(), browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, messages_get(), NSERROR_OK, nsgtk_saveas_dialog(), nsgtk_warning(), NSLOG, path(), and save_complete().

Here is the call graph for this function:

◆ savewindowsize_button_clicked_cb()

static gboolean savewindowsize_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for show downloads tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2779 of file toolbar.c.

References netsurf_mkpath(), nsgtk_config_home, nsoption_set_int, nsoption_write(), browser_window::x, and browser_window::y.

Here is the call graph for this function:

◆ selectall_button_clicked_cb()

static gboolean selectall_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for select all tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2584 of file toolbar.c.

References browser_window_key_press(), browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, and NS_KEY_SELECT_ALL.

Here is the call graph for this function:

◆ set_item_action()

static nserror set_item_action ( struct nsgtk_toolbar tb,
int  itemid,
bool  alt 
)
static

set an item to its alternative action

this is currently only used for the stop/reload button where we also reuse the item sensitivity for the state indicator.

Parameters
tbthe toolbar instance

Definition at line 1186 of file toolbar.c.

References nsgtk_toolbar_item::button, nsgtk_toolbar::items, nsgtk_toolbar_item::location, messages_get(), NSERROR_INVALID, NSERROR_OK, NSGTK_STOCK_REFRESH, NSGTK_STOCK_STOP, RELOADSTOP_BUTTON, remove_underscores(), and nsgtk_toolbar_item::sensitivity.

Referenced by nsgtk_toolbar_throbber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_item_sensitivity()

static nserror set_item_sensitivity ( struct nsgtk_toolbar_item item,
bool  sensitivity 
)
static

set a toolbar items sensitivity

note this does not set menu items sensitivity

Definition at line 1162 of file toolbar.c.

References nsgtk_toolbar_item::button, nsgtk_toolbar_item::location, NSERROR_OK, and nsgtk_toolbar_item::sensitivity.

Referenced by back_button_clicked_cb(), forward_button_clicked_cb(), and nsgtk_toolbar_throbber().

Here is the caller graph for this function:

◆ set_throbber_frame()

static nserror set_throbber_frame ( GtkToolItem *  toolbar_item,
int  frame 
)
static

set a toolbar item to a throbber frame number

Parameters
toolbar_itemThe toolbar item to update
frameThe animation frame number to update to
Returns
NSERROR_OK on success, NSERROR_INVALID if the toolbar item does not contain an image, NSERROR_BAD_SIZE if the frame is out of range.

Definition at line 3257 of file toolbar.c.

References NSERROR_INVALID, NSERROR_OK, nsgtk_throbber_get_frame(), and throbber.

Referenced by next_throbber_frame(), and nsgtk_toolbar_throbber().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showbookmarks_button_clicked_cb()

static gboolean showbookmarks_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for show bookmark tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 3010 of file toolbar.c.

References NSERROR_OK, nsgtk_hotlist_present(), and NSLOG.

Here is the call graph for this function:

◆ showcookies_button_clicked_cb()

static gboolean showcookies_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for show cookies tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 3029 of file toolbar.c.

References NSERROR_OK, nsgtk_cookies_present(), and NSLOG.

Here is the call graph for this function:

◆ stop_button_clicked_cb()

static gboolean stop_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for stop tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 1840 of file toolbar.c.

References browser_window_stop(), nsgtk_toolbar::get_bw, and nsgtk_toolbar::get_ctx.

Here is the call graph for this function:

◆ toggledebugging_button_clicked_cb()

static gboolean toggledebugging_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for show downloads tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2813 of file toolbar.c.

References browser_window_debug(), browser_window::bw, CONTENT_DEBUG_REDRAW, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, and nsgtk_window_update_all().

Here is the call graph for this function:

◆ toolbar_connect_signal()

static nserror toolbar_connect_signal ( struct nsgtk_toolbar tb,
nsgtk_toolbar_button  itemid 
)
static

connect signal handlers to a gtk toolbar item

Definition at line 3314 of file toolbar.c.

References nsgtk_toolbar_item::button, nsgtk_toolbar_item::clicked, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, nsgtk_toolbar::items, NSERROR_OK, nsgtk_completion_connect_signals(), toolbar_item_size_allocate_cb(), URL_BAR_ITEM, url_entry_activate_cb(), url_entry_changed_cb(), url_entry_icon_release_cb(), websearch_entry_activate_cb(), websearch_entry_button_press_cb(), and WEBSEARCH_ITEM.

Referenced by toolbar_connect_signals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbar_connect_signals()

static nserror toolbar_connect_signals ( struct nsgtk_toolbar tb)
static

connect all signals to widgets in a toolbar

Definition at line 3381 of file toolbar.c.

References BACK_BUTTON, itemid_from_location(), nsgtk_toolbar_item::location, NSERROR_OK, PLACEHOLDER_BUTTON, and toolbar_connect_signal().

Referenced by nsgtk_toolbar_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbar_customisation_connect_signals()

static nserror toolbar_customisation_connect_signals ( struct nsgtk_toolbar tb)
static

connect all signals to widgets in a customisation

Definition at line 1333 of file toolbar.c.

References BACK_BUTTON, customisation_toolbar_drag_data_received_cb(), customisation_toolbar_drag_drop_cb(), customisation_toolbar_drag_leave_cb(), customisation_toolbar_drag_motion_cb(), INACTIVE_LOCATION, nsgtk_toolbar::items, nsgtk_toolbar_item::location, NSERROR_OK, PLACEHOLDER_BUTTON, target_entry, toolbar_item_connect_signals(), and nsgtk_toolbar::widget.

Referenced by customisation_toolbar_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbar_customisation_create_toolbox()

static nserror toolbar_customisation_create_toolbox ( struct nsgtk_toolbar_customisation tbc,
int  width 
)
static

creates widgets in customisation toolbox

Parameters
tbcThe toolbar customisation context
widthThe width to layout the toolbox to
Returns
NSERROR_OK on success else error code.

Definition at line 1449 of file toolbar.c.

References add_toolbox_row(), BACK_BUTTON, nsgtk_toolbar_customisation::items, make_toolbox_item(), NSERROR_OK, NSGTK_BUTTON_WIDTH, NSGTK_MIN_STORE_COLUMNS, PLACEHOLDER_BUTTON, and width.

Referenced by cutomize_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbar_destroy_cb()

static void toolbar_destroy_cb ( GtkWidget *  widget,
gpointer  data 
)
static

toolbar delete signal handler

Definition at line 3433 of file toolbar.c.

References next_throbber_frame(), and nsgtk_schedule().

Referenced by nsgtk_toolbar_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbar_item_connect_signals()

static nserror toolbar_item_connect_signals ( struct nsgtk_toolbar tb,
int  itemid 
)
static

connect signals to a toolbar item in a customisation toolbar

Parameters
tbThe toolbar
itemidThe item id within to toolbar to connect
NSERROR_OKon success

Definition at line 721 of file toolbar.c.

References nsgtk_toolbar_item::button, nsgtk_toolbar_item::dataminus, nsgtk_toolbar::items, NSERROR_OK, and target_entry.

Referenced by customisation_toolbar_drag_drop_cb(), and toolbar_customisation_connect_signals().

Here is the caller graph for this function:

◆ toolbar_item_create()

static nserror toolbar_item_create ( nsgtk_toolbar_button  id,
struct nsgtk_toolbar_item item 
)
static

create a toolbar item

create a toolbar item and set up its default handlers

Definition at line 3210 of file toolbar.c.

References INACTIVE_LOCATION, nsgtk_toolbar_item::location, NSERROR_INVALID, NSERROR_OK, and PLACEHOLDER_BUTTON.

Referenced by cutomize_button_clicked_cb(), and nsgtk_toolbar_create().

Here is the caller graph for this function:

◆ toolbar_item_size_allocate_cb()

static void toolbar_item_size_allocate_cb ( GtkWidget *  widget,
GtkAllocation *  alloc,
gpointer  data 
)
static

callback for all toolbar items widget size allocation

handler connected to all toolbar items for the size-allocate signal

Parameters
widgetThe widget the signal is being delivered to.
allocThe size allocation being set.
dataThe toolbar context passed when the signal was connected

Definition at line 1728 of file toolbar.c.

References HISTORY_BUTTON, nsgtk_toolbar::historybase, itemid_from_gtktoolitem(), nsgtk_toolbar::items, nsgtk_toolbar_item::location, nsgtk_toolbar::offset, nsgtk_toolbar::toolbarbase, nsgtk_toolbar::toolbarmem, URL_BAR_ITEM, and nsgtk_toolbar::widget.

Referenced by toolbar_connect_signal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbar_navigate_to_url()

static nserror toolbar_navigate_to_url ( struct nsgtk_toolbar tb,
const char *  urltxt 
)
static

cause the toolbar browsing context to navigate to a new url.

Parameters
tbthe toolbar context.
urltxtThe url string.
Returns
NSERROR_OK on success else appropriate error code.

Definition at line 1236 of file toolbar.c.

References browser_window_navigate(), browser_window::bw, BW_NAVIGATE_HISTORY, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, NSERROR_OK, nsurl_create(), and nsurl_unref().

Referenced by contents_button_clicked_cb(), guide_button_clicked_cb(), home_button_clicked_cb(), and info_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbar_popup_context_menu_cb()

static gboolean toolbar_popup_context_menu_cb ( GtkToolbar *  toolbar,
gint  x,
gint  y,
gint  button,
gpointer  data 
)
static

signal handler for toolbar context menu

Parameters
toolbarThe toolbar event is being delivered to
xThe x coordinate where the click happened
yThe x coordinate where the click happened
buttonthe buttons being pressed
dataThe context pointer passed when the connection was made.
Returns
TRUE to indicate signal handled.
Todo:
stop assuming the context is a gui window

Definition at line 3410 of file toolbar.c.

References nsgtk_toolbar::get_ctx, nsgtk_get_scaffold(), and nsgtk_scaffolding_toolbar_context_menu().

Referenced by nsgtk_toolbar_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ url_entry_activate_cb()

static gboolean url_entry_activate_cb ( GtkWidget *  widget,
gpointer  data 
)
static

callback for url entry widget activation

handler connected to url entry widget for the activate signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE to allow activation.

Definition at line 1940 of file toolbar.c.

References browser_window_navigate(), browser_window::bw, BW_NAVIGATE_HISTORY, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), nsurl_unref(), search_web_omni(), and SEARCH_WEB_OMNI_NONE.

Referenced by toolbar_connect_signal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ url_entry_changed_cb()

static gboolean url_entry_changed_cb ( GtkWidget *  widget,
GdkEventKey *  event,
gpointer  data 
)
static

callback for url entry widget changing

handler connected to url entry widget for the change signal

Parameters
widgetThe widget the signal is being delivered to.
eventThe key change event that changed the entry.
dataThe toolbar context passed when the signal was connected
Returns
TRUE to allow activation.

Definition at line 1975 of file toolbar.c.

References nsgtk_completion_update().

Referenced by toolbar_connect_signal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ url_entry_icon_release_cb()

static void url_entry_icon_release_cb ( GtkEntry *  entry,
GtkEntryIconPosition  icon_pos,
GdkEvent *  event,
gpointer  data 
)
static

callback for url entry widget icon button release

handler connected to url entry widget for the icon release signal

Parameters
widgetThe widget the signal is being delivered to.
eventThe key change event that changed the entry.
dataThe toolbar context passed when the signal was connected
Returns
TRUE to allow activation.

Definition at line 1992 of file toolbar.c.

References browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, and nsgtk_page_info().

Referenced by toolbar_connect_signal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ viewsource_button_clicked_cb()

static gboolean viewsource_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for view source tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2734 of file toolbar.c.

References browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, messages_get_errorcode(), NSERROR_OK, nsgtk_viewsource(), and nsgtk_warning().

Here is the call graph for this function:

◆ websearch_entry_activate_cb()

static gboolean websearch_entry_activate_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for web search tool bar entry item activate signal

handler connected to web search entry widget for the activate signal

Todo:
make this user selectable to switch between opening in new and navigating current window. Possibly improve core search_web interfaces
Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2018 of file toolbar.c.

References browser_window_create(), browser_window::bw, BW_CREATE_FOREGROUND, BW_CREATE_HISTORY, BW_CREATE_TAB, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), nsurl_unref(), search_web_omni(), and SEARCH_WEB_OMNI_SEARCHONLY.

Referenced by toolbar_connect_signal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ websearch_entry_button_press_cb()

static gboolean websearch_entry_button_press_cb ( GtkWidget *  widget,
GdkEventFocus *  f,
gpointer  data 
)
static

handler for web search tool bar item button press signal

allows a click in the websearch entry field to clear the name of the provider.

Todo:
this does not work well, different behaviour wanted perhaps?
Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2059 of file toolbar.c.

Referenced by toolbar_connect_signal().

Here is the caller graph for this function:

◆ zoomminus_button_clicked_cb()

static gboolean zoomminus_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for zoom minus tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2664 of file toolbar.c.

References browser_window_set_scale(), browser_window::bw, nsgtk_toolbar::get_bw, and nsgtk_toolbar::get_ctx.

Here is the call graph for this function:

◆ zoomnormal_button_clicked_cb()

static gboolean zoomnormal_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for zoom normal tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2686 of file toolbar.c.

References browser_window_set_scale(), browser_window::bw, nsgtk_toolbar::get_bw, and nsgtk_toolbar::get_ctx.

Here is the call graph for this function:

◆ zoomplus_button_clicked_cb()

static gboolean zoomplus_button_clicked_cb ( GtkWidget *  widget,
gpointer  data 
)
static

handler for zoom plus tool bar item clicked signal

Parameters
widgetThe widget the signal is being delivered to.
dataThe toolbar context passed when the signal was connected
Returns
TRUE

Definition at line 2643 of file toolbar.c.

References browser_window_set_scale(), browser_window::bw, nsgtk_toolbar::get_bw, and nsgtk_toolbar::get_ctx.

Here is the call graph for this function:

Variable Documentation

◆ target_entry

GtkTargetEntry target_entry
static
Initial value:
= {
(char *)"nsgtk_button_data",
GTK_TARGET_SAME_APP,
0
}

target entry for drag source

Definition at line 613 of file toolbar.c.

Referenced by add_toolbox_row(), cutomize_button_clicked_cb(), toolbar_customisation_connect_signals(), and toolbar_item_connect_signals().