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 /beos/gui.cpp | |
parent | 68eaec5cb4208ee80e7c0610361405fd01fc1b69 (diff) | |
download | netsurf-bd065d4a434755e67642a071e255cba596de8d1e.tar.gz netsurf-bd065d4a434755e67642a071e255cba596de8d1e.tar.bz2 |
split browser gui operations up
Diffstat (limited to 'beos/gui.cpp')
-rw-r--r-- | beos/gui.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/beos/gui.cpp b/beos/gui.cpp index 33337d8ff..3ee47c9e9 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -1059,15 +1059,17 @@ bool path_add_part(char *path, int length, const char *newpart) return true; } -static struct gui_table beos_gui_table = { +static struct gui_clipboard_table beos_clipboard_table = { + .get = gui_get_clipboard, + .set = gui_set_clipboard, +}; + +static struct gui_browser_table beos_browser_table = { .poll = gui_poll, .quit = gui_quit, .get_resource_url = gui_get_resource_url, .launch_url = gui_launch_url, - - .get_clipboard = gui_get_clipboard, - .set_clipboard = gui_set_clipboard, }; @@ -1076,6 +1078,13 @@ int main(int argc, char** argv) { nserror ret; BPath options; + struct gui_table beos_gui_table = { + .browser = &beos_browser_table, + .window = beos_window_table, + .clipboard = &beos_clipboard_table, + .download = beos_download_table, + }; + if (find_directory(B_USER_SETTINGS_DIRECTORY, &options, true) == B_OK) { options.Append("x-vnd.NetSurf"); } @@ -1101,10 +1110,6 @@ int main(int argc, char** argv) /* common initialisation */ BPath messages = get_messages_path(); - - beos_gui_table.window = beos_gui_window_table; - beos_gui_table.download = beos_gui_download_table; - ret = netsurf_init(messages.Path(), &beos_gui_table); if (ret != NSERROR_OK) { die("NetSurf failed to initialise"); @@ -1124,6 +1129,13 @@ int gui_init_replicant(int argc, char** argv) { nserror ret; BPath options; + struct gui_table beos_gui_table = { + .browser = &beos_browser_table, + .window = beos_window_table, + .clipboard = &beos_clipboard_table, + .download = beos_download_table, + }; + if (find_directory(B_USER_SETTINGS_DIRECTORY, &options, true) == B_OK) { options.Append("x-vnd.NetSurf"); } @@ -1145,10 +1157,6 @@ int gui_init_replicant(int argc, char** argv) /* common initialisation */ BPath messages = get_messages_path(); - - beos_gui_table.window = beos_gui_window_table; - beos_gui_table.download = beos_gui_download_table; - ret = netsurf_init(messages.Path(), &beos_gui_table); if (ret != NSERROR_OK) { // FIXME: must not die when in replicant! |