diff options
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/download.c | 4 | ||||
-rw-r--r-- | gtk/download.h | 4 | ||||
-rw-r--r-- | gtk/gui.c | 19 | ||||
-rw-r--r-- | gtk/window.c | 4 | ||||
-rw-r--r-- | gtk/window.h | 2 |
5 files changed, 18 insertions, 15 deletions
diff --git a/gtk/download.c b/gtk/download.c index 1eb53403e..3d287d4d2 100644 --- a/gtk/download.c +++ b/gtk/download.c @@ -845,11 +845,11 @@ static void gui_download_window_done(struct gui_download_window *dw) } -static struct gui_download_table gui_download_table = { +static struct gui_download_table download_table = { .create = gui_download_window_create, .data = gui_download_window_data, .error = gui_download_window_error, .done = gui_download_window_done, }; -struct gui_download_table *nsgtk_gui_download_table = &gui_download_table; +struct gui_download_table *nsgtk_download_table = &download_table; diff --git a/gtk/download.h b/gtk/download.h index 393009dc4..a6e624fbd 100644 --- a/gtk/download.h +++ b/gtk/download.h @@ -21,12 +21,12 @@ #include <gtk/gtk.h> +struct gui_download_table *nsgtk_download_table; + bool nsgtk_download_init(const char *glade_file_location); void nsgtk_download_destroy (void); bool nsgtk_check_for_downloads(GtkWindow *parent); void nsgtk_download_show(GtkWindow *parent); void nsgtk_download_add(gchar *url, gchar *destination); -struct gui_download_table *nsgtk_gui_download_table; - #endif @@ -1128,17 +1128,18 @@ bool path_add_part(char *path, int length, const char *newpart) return true; } +static struct gui_clipboard_table nsgtk_clipboard_table = { + .get = gui_get_clipboard, + .set = gui_set_clipboard, +}; - -static struct gui_table nsgtk_gui_table = { +static struct gui_browser_table nsgtk_browser_table = { .poll = gui_poll, .quit = gui_quit, .set_search_ico = gui_set_search_ico, .get_resource_url = gui_get_resource_url, .launch_url = gui_launch_url, .create_form_select_menu = gui_create_form_select_menu, - .get_clipboard = gui_get_clipboard, - .set_clipboard = gui_set_clipboard, .cert_verify = gui_cert_verify, }; @@ -1150,6 +1151,12 @@ int main(int argc, char** argv) char *messages; char *options; nserror ret; + struct gui_table nsgtk_gui_table = { + .browser = &nsgtk_browser_table, + .window = nsgtk_window_table, + .clipboard = &nsgtk_clipboard_table, + .download = nsgtk_download_table, + }; /* check home directory is available */ nsgtk_check_homedir(); @@ -1178,10 +1185,6 @@ int main(int argc, char** argv) /* common initialisation */ messages = filepath_find(respaths, "Messages"); - - nsgtk_gui_table.window = nsgtk_gui_window_table; - nsgtk_gui_table.download = nsgtk_gui_download_table; - ret = netsurf_init(messages, &nsgtk_gui_table); free(messages); if (ret != NSERROR_OK) { diff --git a/gtk/window.c b/gtk/window.c index 8b66be60d..0ba3c5052 100644 --- a/gtk/window.c +++ b/gtk/window.c @@ -1167,7 +1167,7 @@ gui_window_file_gadget_open(struct gui_window *g, gtk_widget_destroy(dialog); } -static struct gui_window_table gui_window_table = { +static struct gui_window_table window_table = { .create = gui_window_create, .destroy = gui_window_destroy, .redraw = gui_window_redraw_window, @@ -1192,4 +1192,4 @@ static struct gui_window_table gui_window_table = { .stop_throbber = gui_window_stop_throbber, }; -struct gui_window_table *nsgtk_gui_window_table = &gui_window_table; +struct gui_window_table *nsgtk_window_table = &window_table; diff --git a/gtk/window.h b/gtk/window.h index b6953a99e..e242b6e7a 100644 --- a/gtk/window.h +++ b/gtk/window.h @@ -23,6 +23,7 @@ #include "desktop/browser.h" #include "gtk/scaffolding.h" +extern struct gui_window_table *nsgtk_window_table; typedef enum nsgtk_window_signals { NSGTK_WINDOW_SIGNAL_CLICK, @@ -32,7 +33,6 @@ typedef enum nsgtk_window_signals { extern struct gui_window *window_list; extern int temp_open_background; -extern struct gui_window_table *nsgtk_gui_window_table; struct browser_window *nsgtk_get_browser_window(struct gui_window *g); nsgtk_scaffolding *nsgtk_get_scaffold(struct gui_window *g); |