summaryrefslogtreecommitdiff
path: root/gtk/download.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-02-23 08:23:02 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-02-23 08:23:02 +0000
commit5c2d8c35f73d363d44ba30cd0b2be1eb2563ad57 (patch)
tree7e99f90d631c10e9bd5f617e6903c970e3ba1357 /gtk/download.c
parentec1b92cf2436e15afc8180d40dfdebd39c47b9e3 (diff)
downloadnetsurf-5c2d8c35f73d363d44ba30cd0b2be1eb2563ad57.tar.gz
netsurf-5c2d8c35f73d363d44ba30cd0b2be1eb2563ad57.tar.bz2
Hide implementation detail
svn path=/trunk/netsurf/; revision=11769
Diffstat (limited to 'gtk/download.c')
-rw-r--r--gtk/download.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/gtk/download.c b/gtk/download.c
index d9a3c83ab..2a054791e 100644
--- a/gtk/download.c
+++ b/gtk/download.c
@@ -37,6 +37,56 @@
#define UPDATE_RATE 500 /* In milliseconds */
+struct download_context;
+
+enum {
+ NSGTK_DOWNLOAD_PROGRESS,
+ NSGTK_DOWNLOAD_INFO,
+ NSGTK_DOWNLOAD_REMAINING,
+ NSGTK_DOWNLOAD_SPEED,
+ NSGTK_DOWNLOAD_PULSE,
+ NSGTK_DOWNLOAD_STATUS,
+ NSGTK_DOWNLOAD,
+
+ NSGTK_DOWNLOAD_N_COLUMNS
+};
+
+typedef enum {
+ NSGTK_DOWNLOAD_NONE,
+ NSGTK_DOWNLOAD_WORKING,
+ NSGTK_DOWNLOAD_ERROR,
+ NSGTK_DOWNLOAD_COMPLETE,
+ NSGTK_DOWNLOAD_CANCELED
+} nsgtk_download_status;
+
+typedef enum {
+ NSGTK_DOWNLOAD_PAUSE = 1 << 0,
+ NSGTK_DOWNLOAD_RESUME = 1 << 1,
+ NSGTK_DOWNLOAD_CANCEL = 1 << 2,
+ NSGTK_DOWNLOAD_CLEAR = 1 << 3
+} nsgtk_download_actions;
+
+struct gui_download_window {
+ struct download_context *ctx;
+ nsgtk_download_actions sensitivity;
+ nsgtk_download_status status;
+
+ GString *name;
+ GString *time_left;
+ gint size_total;
+ gint size_downloaded;
+ gint progress;
+ gfloat time_remaining;
+ gfloat start_time;
+ gfloat speed;
+
+ GtkTreeRowReference *row;
+ GIOChannel *write;
+ GError *error;
+};
+
+typedef void (*nsgtk_download_selection_action)(struct gui_download_window *dl);
+
static GtkWindow *nsgtk_download_window, *nsgtk_download_parent;
static GtkProgressBar *nsgtk_download_progress_bar;