diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-01-11 14:20:30 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-01-11 14:20:30 +0000 |
commit | d3c392c3d3b516f05fbf71020b2f6774ce20ce8c (patch) | |
tree | bad0d50f6d2d7bfc52774745ce10e69ce0ff5bff /cocoa | |
parent | a856439afb743c7fa16f51108862b99a1f56c82a (diff) | |
download | netsurf-d3c392c3d3b516f05fbf71020b2f6774ce20ce8c.tar.gz netsurf-d3c392c3d3b516f05fbf71020b2f6774ce20ce8c.tar.bz2 |
Initial conversion of netsurf gui to callback vtable
Diffstat (limited to 'cocoa')
-rw-r--r-- | cocoa/NetsurfApp.m | 2 | ||||
-rw-r--r-- | cocoa/gui.h | 2 | ||||
-rw-r--r-- | cocoa/gui.m | 13 |
3 files changed, 10 insertions, 7 deletions
diff --git a/cocoa/NetsurfApp.m b/cocoa/NetsurfApp.m index 33e3bfa43..844904f1c 100644 --- a/cocoa/NetsurfApp.m +++ b/cocoa/NetsurfApp.m @@ -203,7 +203,7 @@ int main( int argc, char **argv ) nsoption_commandline(&argc, argv, NULL); /* common initialisation */ - error = netsurf_init(messages); + error = netsurf_init(messages, cocoa_gui_table); if (error != NSERROR_OK) { die("NetSurf failed to initialise"); } diff --git a/cocoa/gui.h b/cocoa/gui.h index 413727fe6..6ceefa848 100644 --- a/cocoa/gui.h +++ b/cocoa/gui.h @@ -27,3 +27,5 @@ extern NSString * const kAlwaysCancelDownload; extern NSString * const kAlwaysCloseMultipleTabs; void cocoa_autorelease( void ); + +extern struct gui_table *cocoa_gui_table; diff --git a/cocoa/gui.m b/cocoa/gui.m index 72f64bf04..425bd9cb7 100644 --- a/cocoa/gui.m +++ b/cocoa/gui.m @@ -55,7 +55,7 @@ nsurl *gui_get_resource_url(const char *path) return url; } -void gui_poll(bool active) +static void gui_poll(bool active) { cocoa_autorelease(); @@ -68,11 +68,6 @@ void gui_poll(bool active) } } -void gui_quit(void) -{ - // nothing to do -} - struct browser_window; struct gui_window *gui_create_browser_window(struct browser_window *bw, @@ -332,3 +327,9 @@ void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl, /* browser_window_set_gadget_filename(bw, gadget, "filename"); */ } +static struct gui_table gui_table = { + .poll = &gui_poll, +}; + +struct gui_table *cocoa_gui_table = &gui_table; + |