summaryrefslogtreecommitdiff
path: root/monkey
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-01-11 14:20:30 +0000
committerVincent Sanders <vince@kyllikki.org>2014-01-11 14:20:30 +0000
commitd3c392c3d3b516f05fbf71020b2f6774ce20ce8c (patch)
treebad0d50f6d2d7bfc52774745ce10e69ce0ff5bff /monkey
parenta856439afb743c7fa16f51108862b99a1f56c82a (diff)
downloadnetsurf-d3c392c3d3b516f05fbf71020b2f6774ce20ce8c.tar.gz
netsurf-d3c392c3d3b516f05fbf71020b2f6774ce20ce8c.tar.bz2
Initial conversion of netsurf gui to callback vtable
Diffstat (limited to 'monkey')
-rw-r--r--monkey/main.c9
-rw-r--r--monkey/poll.c2
-rw-r--r--monkey/poll.h2
3 files changed, 10 insertions, 3 deletions
diff --git a/monkey/main.c b/monkey/main.c
index 95432e3c7..2e23f55d6 100644
--- a/monkey/main.c
+++ b/monkey/main.c
@@ -55,7 +55,7 @@ nsmonkey_init_resource(const char *resource_path)
return respath;
}
-void gui_quit(void)
+static void gui_quit(void)
{
urldb_save_cookies(nsoption_charp(cookie_jar));
urldb_save(nsoption_charp(url_file));
@@ -113,6 +113,11 @@ static bool nslog_stream_configure(FILE *fptr)
return true;
}
+static struct gui_table monkey_gui_table = {
+ .poll = &monkey_poll,
+ .quit = &gui_quit,
+};
+
int
main(int argc, char **argv)
{
@@ -146,7 +151,7 @@ main(int argc, char **argv)
/* common initialisation */
messages = filepath_find(respaths, "Messages");
- ret = netsurf_init(messages);
+ ret = netsurf_init(messages, &monkey_gui_table);
free(messages);
if (ret != NSERROR_OK) {
die("NetSurf failed to initialise");
diff --git a/monkey/poll.c b/monkey/poll.c
index 024005b89..414d458bd 100644
--- a/monkey/poll.c
+++ b/monkey/poll.c
@@ -88,7 +88,7 @@ monkey_prepare_input(void)
}
void
-gui_poll(bool active)
+monkey_poll(bool active)
{
CURLMcode code;
fd_set read_fd_set, write_fd_set, exc_fd_set;
diff --git a/monkey/poll.h b/monkey/poll.h
index 1aebe6856..4195958c9 100644
--- a/monkey/poll.h
+++ b/monkey/poll.h
@@ -21,4 +21,6 @@
void monkey_prepare_input(void);
+void monkey_poll(bool active);
+
#endif /* NETSURF_MONKEY_POLL_H */