NetSurf
|
#include <string.h>
#include <proto/wb.h>
#include <proto/asl.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/intuition.h>
#include <proto/utility.h>
#include <proto/icon.h>
#include <workbench/icon.h>
#include <proto/window.h>
#include <proto/layout.h>
#include <proto/fuelgauge.h>
#include <classes/window.h>
#include <gadgets/fuelgauge.h>
#include <gadgets/layout.h>
#include <reaction/reaction_macros.h>
#include "utils/errors.h"
#include "utils/nsurl.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/utils.h"
#include "utils/nsoption.h"
#include "netsurf/browser_window.h"
#include "netsurf/mouse.h"
#include "netsurf/window.h"
#include "netsurf/download.h"
#include "content/handlers/image/ico.h"
#include "desktop/download.h"
#include "desktop/save_complete.h"
#include "amiga/gui.h"
#include "amiga/download.h"
#include "amiga/object.h"
#include "amiga/bitmap.h"
#include "amiga/icon.h"
#include "amiga/file.h"
#include "amiga/iff_dr2d.h"
#include "amiga/libs.h"
#include "amiga/misc.h"
#include "amiga/theme.h"
#include "amiga/utf8.h"
Go to the source code of this file.
Data Structures | |
struct | gui_download_window |
context for each download. More... | |
Macros | |
#define | APPNOTIFY_DisplayTime ( TAG_USER + 13 ) |
#define | APPNOTIFY_Percentage ( TAG_USER + 14 ) |
#define | APPNOTIFY_StopBackMsg ( TAG_USER + 17 ) |
Enumerations | |
enum | { OID_D_MAIN = 0 , GID_D_MAIN , GID_D_STATUS , GID_D_CANCEL , GID_D_LAST } |
enum | { AMINS_DLOAD_PROGRESS = 0 , AMINS_DLOAD_OK , AMINS_DLOAD_ERROR , AMINS_DLOAD_ABORT } |
Functions | |
static void | ami_download_window_abort (void *w) |
static BOOL | ami_download_window_event (void *w) |
static struct gui_download_window * | gui_download_window_create (download_context *ctx, struct gui_window *gui) |
static nserror | gui_download_window_data (struct gui_download_window *dw, const char *data, unsigned int size) |
static void | gui_download_window_done (struct gui_download_window *dw) |
static void | gui_download_window_error (struct gui_download_window *dw, const char *error_msg) |
void | ami_free_download_list (struct List *dllist) |
nserror | gui_window_save_link (struct gui_window *g, nsurl *url, const char *title) |
BOOL | ami_download_check_overwrite (const char *file, struct Window *win, ULONG size) |
void | ami_download_parse_backmsg (const char *backmsg) |
Variables | |
static const struct ami_win_event_table | ami_download_table |
static int | downloads_in_progress = 0 |
static struct gui_download_table | download_table |
struct gui_download_table * | amiga_download_table = &download_table |
#define APPNOTIFY_DisplayTime ( TAG_USER + 13 ) |
Definition at line 72 of file download.c.
#define APPNOTIFY_Percentage ( TAG_USER + 14 ) |
Definition at line 76 of file download.c.
#define APPNOTIFY_StopBackMsg ( TAG_USER + 17 ) |
Definition at line 80 of file download.c.
anonymous enum |
Enumerator | |
---|---|
OID_D_MAIN | |
GID_D_MAIN | |
GID_D_STATUS | |
GID_D_CANCEL | |
GID_D_LAST |
Definition at line 83 of file download.c.
anonymous enum |
Enumerator | |
---|---|
AMINS_DLOAD_PROGRESS | |
AMINS_DLOAD_OK | |
AMINS_DLOAD_ERROR | |
AMINS_DLOAD_ABORT |
Definition at line 107 of file download.c.
BOOL ami_download_check_overwrite | ( | const char * | file, |
struct Window * | win, | ||
ULONG | size | ||
) |
Definition at line 481 of file download.c.
References amiga_warn_user_multi(), ASPrintf(), GetFileSize(), human_friendly_bytesize(), messages_get(), and nsoption_bool.
Referenced by ami_file_save(), gui_download_window_create(), and gui_window_save_link().
void ami_download_parse_backmsg | ( | const char * | backmsg | ) |
Definition at line 520 of file download.c.
Referenced by ami_handle_applib().
|
static |
Definition at line 372 of file download.c.
References AMINS_DLOAD_ABORT, gui_download_window::ctx, download_context_abort(), gui_download_window_done(), gui_download_window::result, and gui_download_window::w.
Referenced by ami_download_window_event().
|
static |
Definition at line 380 of file download.c.
References ami_download_window_abort(), GID_D_CANCEL, gui_download_window::objects, OID_D_MAIN, result, and gui_download_window::w.
void ami_free_download_list | ( | struct List * | dllist | ) |
Definition at line 407 of file download.c.
References GetHead(), GetSucc(), and dlnode::node.
Referenced by gui_window_destroy().
|
static |
Definition at line 124 of file download.c.
References ami_download_check_overwrite(), ami_download_table, ami_gui_get_app_id(), ami_gui_get_browser_window(), ami_gui_get_download_list(), ami_gui_get_screen(), ami_gui_get_screen_title(), ami_gui_get_shared_msgport(), ami_gui_get_window(), ami_gui_win_list_add(), ami_utf8_easy(), ami_utf8_free(), AMINS_DLOAD_PROGRESS, AMINS_DLWINDOW, APPNOTIFY_DisplayTime, APPNOTIFY_Percentage, APPNOTIFY_StopBackMsg, ButtonObj, gui_download_window::bw, gui_download_window::ctx, gui_download_window::dln, download_context_get_filename(), download_context_get_total_length(), download_context_get_url(), gui_download_window::downloaded, downloads_in_progress, gui_download_window::fh, dlnode::filename, gui_download_window::fname, FOpen, FuelGaugeObj, GID_D_CANCEL, GID_D_MAIN, GID_D_STATUS, LayoutVObj, messages_get(), dlnode::node, Notify, nsoption_bool, nsurl_access(), gui_download_window::objects, OID_D_MAIN, gui_download_window::result, savereq, gui_download_window::size, gui_download_window::total_size, gui_download_window::url, and WindowObj.
|
static |
Definition at line 245 of file download.c.
References ami_gui_get_app_id(), APPNOTIFY_Percentage, gui_download_window::downloaded, gui_download_window::fh, GID_D_STATUS, messages_get(), Notify, NSERROR_OK, NSERROR_SAVE_FAILED, nsoption_bool, gui_download_window::objects, gui_download_window::progress, RefreshSetGadgetAttrs(), gui_download_window::size, and gui_download_window::win.
|
static |
Definition at line 293 of file download.c.
References ami_gui_get_app_id(), ami_gui_win_list_remove(), ami_try_quit(), amiga_warn_user(), AMINS_DLOAD_OK, AMINS_DLOAD_PROGRESS, browser_window_navigate(), browser_window::bw, gui_download_window::bw, BW_NAVIGATE_DOWNLOAD, gui_download_window::ctx, gui_download_window::dln, download_context_destroy(), downloads_in_progress, FClose, gui_download_window::fh, dlnode::filename, gui_download_window::fname, GetSucc(), messages_get(), dlnode::node, Notify, NSERROR_OK, nsoption_bool, nsurl_create(), nsurl_unref(), gui_download_window::objects, OID_D_MAIN, gui_download_window::result, and gui_download_window::url.
Referenced by ami_download_window_abort(), and gui_download_window_error().
|
static |
Definition at line 364 of file download.c.
References amiga_warn_user(), AMINS_DLOAD_ERROR, gui_download_window_done(), and gui_download_window::result.
nserror gui_window_save_link | ( | struct gui_window * | g, |
nsurl * | url, | ||
const char * | title | ||
) |
Definition at line 428 of file download.c.
References ami_download_check_overwrite(), ami_gui_get_gui_window_2(), ami_gui_get_screen(), ami_gui_get_window(), ami_reset_pointer(), ami_set_pointer(), ASPrintf(), FClose, FOpen, GUI_POINTER_WAIT, messages_get(), NSERROR_OK, nsurl_access(), and savereq.
|
static |
Definition at line 117 of file download.c.
Referenced by gui_download_window_create().
struct gui_download_table* amiga_download_table = &download_table |
Definition at line 534 of file download.c.
Referenced by main().
|
static |
Definition at line 527 of file download.c.
|
static |
Definition at line 122 of file download.c.
Referenced by gui_download_window_create(), and gui_download_window_done().