summaryrefslogtreecommitdiff
path: root/frontends/gtk/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/gtk/window.c')
-rw-r--r--frontends/gtk/window.c52
1 files changed, 43 insertions, 9 deletions
diff --git a/frontends/gtk/window.c b/frontends/gtk/window.c
index 766ae4173..6bf777cbe 100644
--- a/frontends/gtk/window.c
+++ b/frontends/gtk/window.c
@@ -501,7 +501,7 @@ static gboolean nsgtk_window_keypress_event(GtkWidget *widget,
{
struct gui_window *g = data;
uint32_t nskey;
-
+
if (gtk_im_context_filter_keypress(g->input_method, event))
return TRUE;
@@ -617,7 +617,7 @@ static gboolean nsgtk_window_keyrelease_event(GtkWidget *widget,
GdkEventKey *event, gpointer data)
{
struct gui_window *g = data;
-
+
return gtk_im_context_filter_keypress(g->input_method, event);
}
@@ -1288,7 +1288,7 @@ gui_window_file_gadget_open(struct gui_window *g,
NULL);
NSLOG(netsurf, INFO, "*** open dialog: %p", dialog);
-
+
int ret = gtk_dialog_run(GTK_DIALOG(dialog));
NSLOG(netsurf, INFO, "*** return value: %d", ret);
if (ret == GTK_RESPONSE_ACCEPT) {
@@ -1296,7 +1296,7 @@ gui_window_file_gadget_open(struct gui_window *g,
filename = gtk_file_chooser_get_filename(
GTK_FILE_CHOOSER(dialog));
-
+
browser_window_set_gadget_filename(g->bw, gadget, filename);
g_free(filename);
@@ -1305,6 +1305,44 @@ gui_window_file_gadget_open(struct gui_window *g,
gtk_widget_destroy(dialog);
}
+
+/**
+ * process miscellaneous window events
+ *
+ * \param gw The window receiving the event.
+ * \param event The event code.
+ * \return NSERROR_OK when processed ok
+ */
+static nserror
+gui_window_event(struct gui_window *gw, enum gui_window_event event)
+{
+ switch (event) {
+ case GW_EVENT_UPDATE_EXTENT:
+ gui_window_update_extent(gw);
+ break;
+
+ case GW_EVENT_REMOVE_CARET:
+ gui_window_remove_caret(gw);
+ break;
+
+ case GW_EVENT_START_SELECTION:
+ gui_window_start_selection(gw);
+ break;
+
+ case GW_EVENT_START_THROBBER:
+ gui_window_start_throbber(gw);
+ break;
+
+ case GW_EVENT_STOP_THROBBER:
+ gui_window_stop_throbber(gw);
+ break;
+
+ default:
+ break;
+ }
+ return NSERROR_OK;
+}
+
static struct gui_window_table window_table = {
.create = gui_window_create,
.destroy = gui_window_destroy,
@@ -1312,22 +1350,18 @@ static struct gui_window_table window_table = {
.get_scroll = gui_window_get_scroll,
.set_scroll = gui_window_set_scroll,
.get_dimensions = gui_window_get_dimensions,
- .update_extent = gui_window_update_extent,
+ .event = gui_window_event,
.set_icon = gui_window_set_icon,
.set_status = gui_window_set_status,
.set_pointer = gui_window_set_pointer,
.place_caret = gui_window_place_caret,
- .remove_caret = gui_window_remove_caret,
.create_form_select_menu = gui_window_create_form_select_menu,
.file_gadget_open = gui_window_file_gadget_open,
- .start_selection = gui_window_start_selection,
/* from scaffold */
.set_title = nsgtk_window_set_title,
.set_url = gui_window_set_url,
- .start_throbber = gui_window_start_throbber,
- .stop_throbber = gui_window_stop_throbber,
};
struct gui_window_table *nsgtk_window_table = &window_table;