NetSurf
|
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"
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... | |
implementation of toolbar to control browsing context
Definition in file toolbar.c.
#define INACTIVE_LOCATION (-1) |
#define NSGTK_BUTTON_HEIGHT 70 |
#define NSGTK_BUTTON_WIDTH 120 |
#define NSGTK_MIN_STORE_COLUMNS 4 |
#define NSGTK_WEBSEARCH_WIDTH 150 |
#define THROBBER_FRAME_TIME (100) |
#define TOOLBAR_ITEM | ( | identifier, | |
iname, | |||
snstvty, | |||
clicked, | |||
activate, | |||
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 | |||
) | TOOLBAR_ITEM_ ## clicked(identifier, label, iconame) |
#define TOOLBAR_ITEM | ( | identifier, | |
name, | |||
snstvty, | |||
clicked, | |||
activate, | |||
label, | |||
iconame | |||
) |
#define TOOLBAR_ITEM_b | ( | identifier, | |
label, | |||
iconame | |||
) |
#define TOOLBAR_ITEM_b | ( | identifier, | |
label, | |||
iconame | |||
) |
#define TOOLBAR_ITEM_b | ( | name | ) | item->clicked = name##_button_clicked_cb; |
#define TOOLBAR_ITEM_n | ( | identifier, | |
label, | |||
iconame | |||
) |
#define TOOLBAR_ITEM_n | ( | identifier, | |
label, | |||
iconame | |||
) |
#define TOOLBAR_ITEM_n | ( | name | ) | item->clicked = NULL; |
#define TOOLBAR_ITEM_t | ( | identifier, | |
label, | |||
iconame | |||
) |
#define TOOLBAR_ITEM_t | ( | identifier, | |
label, | |||
iconame | |||
) |
#define TOOLBAR_ITEM_t | ( | name | ) | item->clicked = name##_button_clicked_cb; |
#define TOOLBAR_ITEM_y | ( | identifier, | |
label, | |||
iconame | |||
) |
#define TOOLBAR_ITEM_y | ( | identifier, | |
label, | |||
iconame | |||
) |
#define TOOLBAR_ITEM_y | ( | name | ) | item->clicked = name##_button_clicked_cb; |
Location focus state machine.
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. |
|
static |
handler for contents tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 3135 of file toolbar.c.
References nsgtk_about_dialog_init(), parent, and nsgtk_toolbar::widget.
|
static |
add a row to a toolbar customisation toolbox
tbc | The toolbar customisation context |
startitem | The item index of the beginning of the row |
enditem | The item index of the beginning of the next row |
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().
|
static |
handler for add bookmark tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
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
tb | The toolbar to apply customisation to |
NSERROR_OK | on 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().
|
static |
handler for back tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
|
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().
|
static |
handler for contents tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 3071 of file toolbar.c.
References messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), and toolbar_navigate_to_url().
|
static |
handler for copy tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
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().
|
static |
customisation container destroy handler
Definition at line 1558 of file toolbar.c.
Referenced by cutomize_button_clicked_cb().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
static |
populates the customization toolbar with widgets in correct order
tb | toolbar |
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().
|
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().
|
static |
handler for cut tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
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.
|
static |
handler for debug box tree tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
handler for debug dom tree tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
handler for delete tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
static |
handler for show downloads tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 2762 of file toolbar.c.
References nsgtk_download_show().
|
static |
handler for forward tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
|
static |
handler for global history tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 2969 of file toolbar.c.
References NSERROR_OK, nsgtk_global_history_present(), and NSLOG.
|
static |
handler for contents tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 3092 of file toolbar.c.
References messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), and toolbar_navigate_to_url().
|
static |
handler for history tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 2955 of file toolbar.c.
References localhistory_button_clicked_cb().
|
static |
handler for home tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 1910 of file toolbar.c.
References messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), nsoption_charp, and toolbar_navigate_to_url().
|
static |
handler for contents tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 3114 of file toolbar.c.
References messages_get_errorcode(), NSERROR_OK, nsgtk_warning(), and toolbar_navigate_to_url().
|
static |
Definition at line 1374 of file toolbar.c.
References NSGTK_BUTTON_HEIGHT, and NSGTK_BUTTON_WIDTH.
Referenced by add_toolbox_row().
|
static |
find the toolbar item with a given gtk widget.
tb | the toolbar instance |
toolitem | the tool item widget to search for |
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().
|
static |
find the toolbar item with a given location.
tb | the toolbar instance |
locaction | the location to search for |
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().
|
static |
handler for local history tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
widget factory for creation of toolbar item widgets
i | the id of the widget |
theme | the theme to make the widgets from |
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().
|
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().
|
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().
|
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().
|
static |
create url bar toolbar item widget
create a gtk entry widget with a completion attached
sensitivity | if the entry should be created sensitive to input |
edit | if 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().
|
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().
|
static |
widget factory for creation of toolbar item widgets for the toolbox
itemid | the id of the 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().
|
static |
handler for new tab tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
handler for new window tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
Make the throbber run.
scheduled callback to update the throbber
p | The 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().
|
static |
create a new browser window
creates a browser window with default url depending on user choices.
bw | The browser window to pass for existing window/ |
intab | true if the new window should be in a tab else false for new window. |
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().
|
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().
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
[in] | builder | The gtk builder object the toolbar is being created from |
[out] | toolbar | a pointer to receive the result. |
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().
|
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().
|
static |
Find the correct location for popping up a window for the chosen item.
tb | The toolbar to select from |
item_idx | The toolbar item to select from |
out_x | Filled with an appropriate X coordinate |
out_y | Filled 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().
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.
toolbar | A toolbar returned from a creation |
itemid | the id of the item to activate |
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().
nserror nsgtk_toolbar_page_info_change | ( | struct nsgtk_toolbar * | tb | ) |
Page info has changed state.
toolbar | A toolbar returned from a creation |
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().
nserror nsgtk_toolbar_position_local_history | ( | struct nsgtk_toolbar * | tb | ) |
position the local history window appropriately
tb | The 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().
nserror nsgtk_toolbar_position_page_info | ( | struct nsgtk_toolbar * | tb, |
struct nsgtk_pi_window * | win | ||
) |
position the page info window appropriately
tb | The toolbar to position relative to |
win | The 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().
nserror nsgtk_toolbar_restyle | ( | struct nsgtk_toolbar * | tb | ) |
Update toolbar style and size based on current settings.
toolbar | A toolbar returned from a creation |
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().
nserror nsgtk_toolbar_set_url | ( | struct nsgtk_toolbar * | tb, |
nsurl * | url | ||
) |
Update the toolbar url entry.
toolbar | A toolbar returned from a creation |
url | The URL to set |
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().
nserror nsgtk_toolbar_set_websearch_image | ( | struct nsgtk_toolbar * | tb, |
GdkPixbuf * | pixbuf | ||
) |
set the websearch image
toolbar | A toolbar returned from a creation |
pixbuf | The pixel buffer data to use to set the web search icon |
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().
nserror nsgtk_toolbar_show | ( | struct nsgtk_toolbar * | tb, |
bool | show | ||
) |
set the toolbar to be shown or hidden
toolbar | A toolbar returned from a creation |
show | true to show the toolbar and false to hide it. |
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().
nserror nsgtk_toolbar_throbber | ( | struct nsgtk_toolbar * | tb, |
bool | active | ||
) |
Start or stop a throbber in a toolbar.
toolbar | A toolbar returned from a creation |
active | True if the throbber animation should play. |
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().
nserror nsgtk_toolbar_update | ( | struct nsgtk_toolbar * | tb | ) |
Update the toolbar items being shown based on current settings.
toolbar | A toolbar returned from a creation |
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().
|
static |
handler for open file tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
handler for open location tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 3048 of file toolbar.c.
References nsgtk_toolbar_item::button, nsgtk_toolbar::items, and URL_BAR_ITEM.
|
static |
handler for openmenu tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 3152 of file toolbar.c.
References nsgtk_toolbar::get_ctx, nsgtk_get_scaffold(), and nsgtk_scaffolding_burger_menu().
|
static |
handler for paste tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
static |
handler for pdf export tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
static |
handler for plain text export tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
populates a toolbar with widgets in correct order
tb | toolbar |
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().
|
static |
handler for preferences tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 2615 of file toolbar.c.
References browser_window::bw, nsgtk_toolbar::get_bw, nsgtk_toolbar::get_ctx, and nsgtk_preferences().
|
static |
handler for print tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
handler for quit tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 2445 of file toolbar.c.
References nsgtk_scaffolding_destroy_all().
|
static |
handler for reload tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
static |
handler for reload/stop tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
static |
returns a string without its underscores
s | The string to change. |
replacespace | true to insert a space where there was an underscore |
Definition at line 261 of file toolbar.c.
Referenced by make_toolbar_item_button(), make_toolbar_item_history(), and set_item_action().
|
static |
handler for full save export tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
handler for show downloads tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
static |
handler for select all tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
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.
tb | the 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().
|
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().
|
static |
set a toolbar item to a throbber frame number
toolbar_item | The toolbar item to update |
frame | The animation frame number to update to |
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().
|
static |
handler for show bookmark tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 3010 of file toolbar.c.
References NSERROR_OK, nsgtk_hotlist_present(), and NSLOG.
|
static |
handler for show cookies tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 3029 of file toolbar.c.
References NSERROR_OK, nsgtk_cookies_present(), and NSLOG.
|
static |
handler for stop tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 1840 of file toolbar.c.
References browser_window_stop(), nsgtk_toolbar::get_bw, and nsgtk_toolbar::get_ctx.
|
static |
handler for show downloads tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
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().
|
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().
|
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().
|
static |
creates widgets in customisation toolbox
tbc | The toolbar customisation context |
width | The width to layout the toolbox to |
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().
|
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().
|
static |
connect signals to a toolbar item in a customisation toolbar
tb | The toolbar |
itemid | The item id within to toolbar to connect |
NSERROR_OK | on 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().
|
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().
|
static |
callback for all toolbar items widget size allocation
handler connected to all toolbar items for the size-allocate signal
widget | The widget the signal is being delivered to. |
alloc | The size allocation being set. |
data | The 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().
|
static |
cause the toolbar browsing context to navigate to a new url.
tb | the toolbar context. |
urltxt | The url string. |
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().
|
static |
signal handler for toolbar context menu
toolbar | The toolbar event is being delivered to |
x | The x coordinate where the click happened |
y | The x coordinate where the click happened |
button | the buttons being pressed |
data | The context pointer passed when the connection was made. |
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().
|
static |
callback for url entry widget activation
handler connected to url entry widget for the activate signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
callback for url entry widget changing
handler connected to url entry widget for the change signal
widget | The widget the signal is being delivered to. |
event | The key change event that changed the entry. |
data | The toolbar context passed when the signal was connected |
Definition at line 1975 of file toolbar.c.
References nsgtk_completion_update().
Referenced by toolbar_connect_signal().
|
static |
callback for url entry widget icon button release
handler connected to url entry widget for the icon release signal
widget | The widget the signal is being delivered to. |
event | The key change event that changed the entry. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
handler for view source tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
static |
handler for web search tool bar entry item activate signal
handler connected to web search entry widget for the activate signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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().
|
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.
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
Definition at line 2059 of file toolbar.c.
Referenced by toolbar_connect_signal().
|
static |
handler for zoom minus tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
static |
handler for zoom normal tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
static |
handler for zoom plus tool bar item clicked signal
widget | The widget the signal is being delivered to. |
data | The toolbar context passed when the signal was connected |
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.
|
static |
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().