48#define MENUPROTO(x) static gboolean nsgtk_on_##x##_activate( \
49 GtkMenuItem *widget, gpointer g)
50#define MENUEVENT(x) { #x, G_CALLBACK(nsgtk_on_##x##_activate) }
51#define MENUHANDLER(x) gboolean nsgtk_on_##x##_activate(GtkMenuItem *widget, \
180 GtkWidget *save_dialog;
184 save_dialog = gtk_file_chooser_dialog_new(
"Save File",
186 GTK_FILE_CHOOSER_ACTION_SAVE,
191 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(save_dialog),
192 getenv(
"HOME") ? getenv(
"HOME") :
"/");
194 gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(save_dialog),
197 if (gtk_dialog_run(GTK_DIALOG(save_dialog)) == GTK_RESPONSE_ACCEPT) {
198 gchar *filename = gtk_file_chooser_get_filename(
199 GTK_FILE_CHOOSER(save_dialog));
205 gtk_widget_destroy(save_dialog);
219 while (event->widget != NULL) {
220 w = GTK_WIDGET(gtk_builder_get_object(ghwin->
builder,
224 "Unable to connect menu widget ""%s""",
227 g_signal_connect(G_OBJECT(w),
286 .background_images =
true,
309 ncwin = calloc(1,
sizeof(*ncwin));
316 NSLOG(netsurf, INFO,
"History UI builder init failed");
321 gtk_builder_connect_signals(ncwin->
builder, NULL);
323 ncwin->
wnd = GTK_WINDOW(gtk_builder_get_object(ncwin->
builder,
327 gtk_builder_get_object(ncwin->
builder,
328 "globalHistoryScrolled"));
331 gtk_builder_get_object(ncwin->
builder,
332 "globalHistoryDrawingArea"));
335 g_signal_connect(G_OBJECT(ncwin->
wnd),
337 G_CALLBACK(gtk_widget_hide_on_delete),
Compatibility functions for older GTK versions (interface)
#define NSGTK_STOCK_CANCEL
nserror global_history_init(void *core_window_handle)
Initialise the global history.
nserror global_history_expand(bool only_folders)
Expand the treeview's nodes.
nserror global_history_fini(void)
Finalise the global history.
void global_history_redraw(int x, int y, struct rect *clip, const struct redraw_context *ctx)
Redraw the global history.
nserror global_history_export(const char *path, const char *title)
Save global history to file (html)
nserror global_history_contract(bool all)
Contract the treeview's nodes.
bool global_history_keypress(uint32_t key)
Key press handling.
void global_history_mouse_action(browser_mouse_state mouse, int x, int y)
Handles all kinds of mouse action.
nserror
Enumeration of error codes.
@ NSERROR_NOT_IMPLEMENTED
Functionality is not implemented.
@ NSERROR_NOMEM
Memory exhaustion.
nserror nsgtk_global_history_present(void)
make the global history window visible.
nserror nsgtk_global_history_destroy(void)
Destroys the global history window and performs any other necessary cleanup actions.
static struct nsgtk_global_history_window * global_history_window
static nserror nsgtk_global_history_init(void)
Creates the window for the global history tree.
static struct menu_events menu_events[]
static nserror nsgtk_global_history_mouse(struct nsgtk_corewindow *nsgtk_cw, browser_mouse_state mouse_state, int x, int y)
callback for mouse action on global history window
static void nsgtk_global_history_init_menu(struct nsgtk_global_history_window *ghwin)
Connects menu events in the global history window.
static nserror nsgtk_global_history_draw(struct nsgtk_corewindow *nsgtk_cw, struct rect *r)
callback on draw event for global history window
static nserror nsgtk_global_history_key(struct nsgtk_corewindow *nsgtk_cw, uint32_t nskey)
callback for keypress on global history window
Interface to GTK global history manager.
Target independent plotting GTK+ interface.
nserror nsgtk_corewindow_init(struct nsgtk_corewindow *nsgtk_cw)
initialise elements of gtk core window.
nserror nsgtk_corewindow_fini(struct nsgtk_corewindow *nsgtk_cw)
finalise elements of gtk core window.
const struct plotter_table nsgtk_plotters
GTK plotter table.
browser_mouse_state
Mouse state.
Target independent plotting interface.
Interface to key press operations.
#define NSLOG(catname, level, logmsg, args...)
nserror nsgtk_builder_new_from_resname(const char *resname, GtkBuilder **builder_out)
Create gtk builder object for the named ui resource.
Interface to gtk builtin resource handling.
nserror(* key)(struct nsgtk_corewindow *nsgtk_cw, uint32_t nskey)
callback for keypress on nsgtk core window
nserror(* draw)(struct nsgtk_corewindow *nsgtk_cw, struct rect *r)
callback to draw on drawable area of nsgtk core window
GtkScrolledWindow * scrolled
scrollable area drawing area is within
nserror(* mouse)(struct nsgtk_corewindow *nsgtk_cw, browser_mouse_state mouse_state, int x, int y)
callback for mouse event on nsgtk core window
GtkDrawingArea * drawing_area
GTK drawable widget.
struct nsgtk_corewindow core
bool interactive
Redraw to show interactive features.