NetSurf
Functions
toolbar.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

nserror nsgtk_toolbar_create (GtkBuilder *builder, struct browser_window *(*get_bw)(void *ctx), void *get_bw_ctx, bool want_location_focus, struct nsgtk_toolbar **toolbar)
 create a control toolbar More...
 
nserror nsgtk_toolbar_update (struct nsgtk_toolbar *tb)
 Update the toolbar items being shown based on current settings. 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_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...
 
void nsgtk_toolbar_customization_init (struct nsgtk_scaffolding *g)
 Initialise customization of toolbar entries. More...
 

Function Documentation

◆ 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_customization_init()

void nsgtk_toolbar_customization_init ( struct nsgtk_scaffolding g)

Initialise customization of toolbar entries.

◆ 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_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: