52#define MENUPROTO(x) static gboolean nsgtk_on_##x##_activate( \
53 GtkMenuItem *widget, gpointer g)
54#define MENUEVENT(x) { #x, G_CALLBACK(nsgtk_on_##x##_activate) }
55#define MENUHANDLER(x) gboolean nsgtk_on_##x##_activate(GtkMenuItem *widget, \
116 GtkWidget *save_dialog;
120 save_dialog = gtk_file_chooser_dialog_new(
"Save File",
122 GTK_FILE_CHOOSER_ACTION_SAVE,
127 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(save_dialog),
128 getenv(
"HOME") ? getenv(
"HOME") :
"/");
130 gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(save_dialog),
133 if (gtk_dialog_run(GTK_DIALOG(save_dialog)) == GTK_RESPONSE_ACCEPT) {
134 gchar *filename = gtk_file_chooser_get_filename(
135 GTK_FILE_CHOOSER(save_dialog));
141 gtk_widget_destroy(save_dialog);
237 while (event->widget != NULL) {
238 w = GTK_WIDGET(gtk_builder_get_object(hlwin->
builder,
242 "Unable to connect menu widget ""%s""",
245 g_signal_connect(G_OBJECT(w),
302 .background_images =
true,
325 ncwin = calloc(1,
sizeof(*ncwin));
332 NSLOG(netsurf, INFO,
"Hotlist UI builder init failed");
337 gtk_builder_connect_signals(ncwin->
builder, NULL);
339 ncwin->
wnd = GTK_WINDOW(gtk_builder_get_object(ncwin->
builder,
343 gtk_builder_get_object(ncwin->
builder,
"hotlistScrolled"));
346 gtk_builder_get_object(ncwin->
builder,
"hotlistDrawingArea"));
349 g_signal_connect(G_OBJECT(ncwin->
wnd),
351 G_CALLBACK(gtk_widget_hide_on_delete),
Compatibility functions for older GTK versions (interface)
#define NSGTK_STOCK_CANCEL
bool hotlist_keypress(uint32_t key)
Key press handling.
nserror hotlist_add_entry(nsurl *url, const char *title, bool at_y, int y)
Add an entry to the hotlist for given Title/URL.
void hotlist_mouse_action(browser_mouse_state mouse, int x, int y)
Handles all kinds of mouse action.
nserror hotlist_manager_init(void *core_window_handle)
Initialise the hotlist manager.
nserror hotlist_manager_fini(void)
Finalise the hotlist manager.
void hotlist_redraw(int x, int y, struct rect *clip, const struct redraw_context *ctx)
Redraw the hotlist.
nserror hotlist_add_folder(const char *title, bool at_y, int y)
Add a folder to the hotlist.
nserror hotlist_export(const char *path, const char *title)
Save hotlist to file.
nserror hotlist_expand(bool only_folders)
Expand the treeview's nodes.
void hotlist_edit_selection(void)
Edit the first selected node.
nserror hotlist_contract(bool all)
Contract the treeview's nodes.
nserror
Enumeration of error codes.
@ NSERROR_NOT_IMPLEMENTED
Functionality is not implemented.
@ NSERROR_NOMEM
Memory exhaustion.
static void nsgtk_hotlist_init_menu(struct nsgtk_hotlist_window *hlwin)
Connects menu events in the hotlist window.
static nserror nsgtk_hotlist_key(struct nsgtk_corewindow *nsgtk_cw, uint32_t nskey)
callback for keypress on hotlist window
static struct nsgtk_hotlist_window * hotlist_window
static nserror nsgtk_hotlist_mouse(struct nsgtk_corewindow *nsgtk_cw, browser_mouse_state mouse_state, int x, int y)
callback for mouse action on hotlist window
static struct menu_events menu_events[]
static nserror nsgtk_hotlist_draw(struct nsgtk_corewindow *nsgtk_cw, struct rect *r)
callback on draw event for hotlist window
nserror nsgtk_hotlist_destroy(void)
Free any resources allocated for the hotlist window.
static nserror nsgtk_hotlist_init(void)
Creates the window for the hotlist tree.
nserror nsgtk_hotlist_present(void)
make the hotlist window visible.
Interface to GTK bookmarks (hotlist).
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: 1 is primary mouse button.
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.
hotlist window container for gtk.
struct nsgtk_corewindow core
bool interactive
Redraw to show interactive features.
Option reading and saving interface.