summaryrefslogtreecommitdiff
path: root/beos
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2014-01-14 16:04:02 +0000
committerVincent Sanders <vince@netsurf-browser.org>2014-01-14 16:04:02 +0000
commit8dfe22515312a8ecf4da974feb31b0f5e7f317e5 (patch)
tree163091cfeda5c4cb644e08e7649f70788070a560 /beos
parentd18c8ed4521714c3fff3cca64685b8192ca0e075 (diff)
downloadnetsurf-8dfe22515312a8ecf4da974feb31b0f5e7f317e5.tar.gz
netsurf-8dfe22515312a8ecf4da974feb31b0f5e7f317e5.tar.bz2
move download operations to download table
Diffstat (limited to 'beos')
-rw-r--r--beos/download.cpp17
-rw-r--r--beos/download.h1
-rw-r--r--beos/gui.cpp5
3 files changed, 19 insertions, 4 deletions
diff --git a/beos/download.cpp b/beos/download.cpp
index e20281c2f..b62ab2ffb 100644
--- a/beos/download.cpp
+++ b/beos/download.cpp
@@ -178,7 +178,7 @@ NSDownloadWindow::Failure(const char* error)
}
-struct gui_download_window *gui_download_window_create(download_context *ctx,
+static struct gui_download_window *gui_download_window_create(download_context *ctx,
struct gui_window *parent)
{
struct gui_download_window *download = (struct gui_download_window*)malloc(sizeof *download);
@@ -209,7 +209,7 @@ struct gui_download_window *gui_download_window_create(download_context *ctx,
}
-nserror gui_download_window_data(struct gui_download_window *dw,
+static nserror gui_download_window_data(struct gui_download_window *dw,
const char *data, unsigned int size)
{
dw->window->Progress(size);
@@ -222,7 +222,7 @@ nserror gui_download_window_data(struct gui_download_window *dw,
}
-void gui_download_window_error(struct gui_download_window *dw,
+static void gui_download_window_error(struct gui_download_window *dw,
const char *error_msg)
{
dw->window->Failure(error_msg);
@@ -232,7 +232,7 @@ void gui_download_window_error(struct gui_download_window *dw,
}
-void gui_download_window_done(struct gui_download_window *dw)
+static void gui_download_window_done(struct gui_download_window *dw)
{
dw->window->Success();
@@ -248,3 +248,12 @@ void gui_download_window_done(struct gui_download_window *dw)
dw->storageLock->Unlock();
}
+static struct gui_download_table gui_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 *beos_gui_download_table = &gui_download_table;
+
diff --git a/beos/download.h b/beos/download.h
index 9c8d3adcd..962f3b7d9 100644
--- a/beos/download.h
+++ b/beos/download.h
@@ -16,3 +16,4 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+struct gui_download_table *beos_gui_download_table;
diff --git a/beos/gui.cpp b/beos/gui.cpp
index efac0bb4c..45a0e6bc7 100644
--- a/beos/gui.cpp
+++ b/beos/gui.cpp
@@ -1111,6 +1111,7 @@ int main(int argc, char** argv)
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) {
@@ -1152,6 +1153,10 @@ 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!