diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2014-01-15 19:37:05 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2014-01-15 19:37:05 +0000 |
commit | bd065d4a434755e67642a071e255cba596de8d1e (patch) | |
tree | 343a4343ace1c38f3ab67b3a9405a629fbbaa117 /atari | |
parent | 68eaec5cb4208ee80e7c0610361405fd01fc1b69 (diff) | |
download | netsurf-bd065d4a434755e67642a071e255cba596de8d1e.tar.gz netsurf-bd065d4a434755e67642a071e255cba596de8d1e.tar.bz2 |
split browser gui operations up
Diffstat (limited to 'atari')
-rwxr-xr-x | atari/download.c | 5 | ||||
-rwxr-xr-x | atari/download.h | 4 | ||||
-rw-r--r-- | atari/gui.c | 22 |
3 files changed, 17 insertions, 14 deletions
diff --git a/atari/download.c b/atari/download.c index 4da9ef345..8d4786e23 100755 --- a/atari/download.c +++ b/atari/download.c @@ -455,12 +455,11 @@ static void gui_download_window_done(struct gui_download_window *dw) gui_window_set_status(input_window, messages_get("Done") );
}
-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 *atari_gui_download_table = &gui_download_table; - +struct gui_download_table *atari_download_table = &download_table; diff --git a/atari/download.h b/atari/download.h index a5da60538..82f89c050 100755 --- a/atari/download.h +++ b/atari/download.h @@ -19,6 +19,8 @@ #ifndef NS_ATARI_DOWNLOAD_H
#define NS_ATARI_DOWNLOAD_H
+extern struct gui_download_table *atari_download_table; + #define MAX_SLEN_LBL_DONE 64
#define MAX_SLEN_LBL_PERCENT 5
#define MAX_SLEN_LBL_SPEED 13
@@ -58,6 +60,4 @@ struct gui_download_window { bool close_on_finish;
};
-struct gui_download_table *atari_gui_download_table; - #endif
diff --git a/atari/gui.c b/atari/gui.c index 924ac686a..49e3046e2 100644 --- a/atari/gui.c +++ b/atari/gui.c @@ -1045,15 +1045,16 @@ static struct gui_window_table atari_window_table = { .stop_throbber = gui_window_stop_throbber, }; -static struct gui_table atari_gui_table = { +static struct gui_clipboard_table atari_clipboard_table = { + .get = gui_get_clipboard, + .set = gui_set_clipboard, +}; + +static struct gui_browser_table atari_browser_table = { .poll = gui_poll, .quit = gui_quit, .get_resource_url = gui_get_resource_url, - .get_clipboard = gui_get_clipboard, - .set_clipboard = gui_set_clipboard, .cert_verify = gui_cert_verify, - - .window = &atari_window_table; }; /* #define WITH_DBG_LOGFILE 1 */ @@ -1071,6 +1072,12 @@ int main(int argc, char** argv) struct stat stat_buf; nsurl *url; nserror ret; + struct gui_table atari_gui_table = { + .browser = &atari_browser_table, + .window = &atari_window_table, + .clipboard = &atari_clipboard_table, + .download = atari_download_table, + }; /* @todo logging file descriptor update belongs in a nslog_init callback */ setbuf(stderr, NULL); @@ -1104,10 +1111,7 @@ int main(int argc, char** argv) /* common initialisation */ LOG(("Initialising core...")); - - atari_gui_table.download = nsgtk_gui_download_table; - - ret = netsurf_init(messages, atari_gui_table); + ret = netsurf_init(messages, &atari_gui_table); if (ret != NSERROR_OK) { die("NetSurf failed to initialise"); } |