diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-01-22 23:19:57 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-01-23 00:00:18 +0000 |
commit | 047569339406f2be1637ae4cee5dd0c9a9c2328f (patch) | |
tree | 3d3909b4bc3d27cd7a9e146d32539ce752b33310 /cocoa | |
parent | 4684e9665d2ddff50f4a8e9a16d73224d2617180 (diff) | |
download | netsurf-047569339406f2be1637ae4cee5dd0c9a9c2328f.tar.gz netsurf-047569339406f2be1637ae4cee5dd0c9a9c2328f.tar.bz2 |
create table for fetcher operations and move all operations into it
Diffstat (limited to 'cocoa')
-rw-r--r-- | cocoa/NetsurfApp.m | 1 | ||||
-rw-r--r-- | cocoa/fetch.h | 19 | ||||
-rw-r--r-- | cocoa/fetch.m | 8 | ||||
-rw-r--r-- | cocoa/gui.h | 1 | ||||
-rw-r--r-- | cocoa/gui.m | 17 |
5 files changed, 35 insertions, 11 deletions
diff --git a/cocoa/NetsurfApp.m b/cocoa/NetsurfApp.m index 158c195e6..5643efd6c 100644 --- a/cocoa/NetsurfApp.m +++ b/cocoa/NetsurfApp.m @@ -190,6 +190,7 @@ int main( int argc, char **argv ) .window = cocoa_window_table, .clipboard = cocoa_clipboard_table, .download = cocoa_download_table, + .fetch = cocoa_fetch_table, }; cocoa_autorelease(); diff --git a/cocoa/fetch.h b/cocoa/fetch.h new file mode 100644 index 000000000..4a50b6e8d --- /dev/null +++ b/cocoa/fetch.h @@ -0,0 +1,19 @@ +/* + * Copyright 2011 Sven Weidauer <sven.weidauer@gmail.com> + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +const char *fetch_filetype(const char *unix_path); diff --git a/cocoa/fetch.m b/cocoa/fetch.m index ff1496246..b1c7aea9e 100644 --- a/cocoa/fetch.m +++ b/cocoa/fetch.m @@ -21,6 +21,8 @@ #import "utils/log.h" #import "content/fetch.h" +#import "cocoa/fetch.h" + static char cocoafiletype[200]; static const struct mimemap_s { @@ -91,9 +93,3 @@ const char *fetch_filetype(const char *unix_path) return cocoafiletype; } - - -char *fetch_mimetype(const char *ro_path) -{ - return strdup( fetch_filetype( ro_path ) ); -} diff --git a/cocoa/gui.h b/cocoa/gui.h index 757140030..55b69072e 100644 --- a/cocoa/gui.h +++ b/cocoa/gui.h @@ -20,6 +20,7 @@ extern struct gui_window_table *cocoa_window_table; extern struct gui_clipboard_table *cocoa_clipboard_table; +extern struct gui_fetch_table *cocoa_fetch_table; extern struct gui_browser_table *cocoa_browser_table; extern NSString * const kCookiesFileOption; diff --git a/cocoa/gui.m b/cocoa/gui.m index 4d43fe4f0..2a97df39d 100644 --- a/cocoa/gui.m +++ b/cocoa/gui.m @@ -24,6 +24,7 @@ #import "cocoa/BrowserViewController.h" #import "cocoa/BrowserWindowController.h" #import "cocoa/FormSelectMenu.h" +#import "cocoa/fetch.h" #import "desktop/gui.h" #import "desktop/netsurf.h" @@ -311,16 +312,22 @@ static struct gui_window_table window_table = { struct gui_window_table *cocoa_window_table = &window_table; +static struct gui_fetch_table fetch_table = { + .filename_from_path = filename_from_path, + .path_add_part = path_add_part, + .filetype = fetch_filetype, + + .get_resource_url = gui_get_resource_url, +}; + +struct gui_fetch_table *cocoa_fetch_table = &fetch_table; + static struct gui_browser_table browser_table = { .poll = gui_poll, - .get_resource_url = gui_get_resource_url, + .launch_url = gui_launch_url, .create_form_select_menu = gui_create_form_select_menu, .cert_verify = gui_cert_verify, - .filename_from_path = filename_from_path, - .path_add_part = path_add_part, }; struct gui_browser_table *cocoa_browser_table = &browser_table; - - |