NetSurf
Functions | Variables
download.c File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdbool.h>
#include <time.h>
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/nsoption.h"
#include "netsurf/inttypes.h"
#include "netsurf/browser_window.h"
#include "netsurf/download.h"
#include "desktop/save_complete.h"
#include "desktop/download.h"
#include "atari/gui.h"
#include "atari/misc.h"
#include "atari/res/netsurf.rsh"
#include "atari/download.h"
#include "atari/osspec.h"
Include dependency graph for download.c:

Go to the source code of this file.

Functions

static void gui_download_window_destroy (struct gui_download_window *gdw)
 
static void on_abort_click (struct gui_download_window *dw)
 
static void on_cbrdy_click (struct gui_download_window *dw)
 
static void on_close (struct gui_download_window *dw)
 
static void on_redraw (struct gui_download_window *dw, GRECT *clip)
 
static void toolbar_redraw_cb (GUIWIN *win, uint16_t msg, GRECT *clip)
 
static short on_aes_event (GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
 
static char * select_filepath (const char *path, const char *filename)
 
static struct gui_download_windowgui_download_window_create (download_context *ctx, struct gui_window *parent)
 
static nserror gui_download_window_data (struct gui_download_window *dw, const char *data, unsigned int size)
 
static void gui_download_window_error (struct gui_download_window *dw, const char *error_msg)
 
static void gui_download_window_done (struct gui_download_window *dw)
 

Variables

struct gui_windowinput_window
 
GRECT desk_area
 
static struct gui_download_table download_table
 
struct gui_download_tableatari_download_table = &download_table
 

Function Documentation

◆ gui_download_window_create()

static struct gui_download_window * gui_download_window_create ( download_context ctx,
struct gui_window parent 
)
static

◆ gui_download_window_data()

static nserror gui_download_window_data ( struct gui_download_window dw,
const char *  data,
unsigned int  size 
)
static

◆ gui_download_window_destroy()

static void gui_download_window_destroy ( struct gui_download_window gdw)
static

Definition at line 195 of file download.c.

References gui_download_window::aes_handle, gui_download_window::ctx, gui_download_window::destination, download_context_abort(), download_context_destroy(), gui_download_window::fbuf, gui_download_window::fd, gui_download_window::guiwin, NSATARI_DOWNLOAD_WORKING, NSLOG, and gui_download_window::status.

Referenced by gui_download_window_create(), and on_close().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gui_download_window_done()

static void gui_download_window_done ( struct gui_download_window dw)
static

◆ gui_download_window_error()

static void gui_download_window_error ( struct gui_download_window dw,
const char *  error_msg 
)
static

Definition at line 407 of file download.c.

References atari_window_set_status(), gui_download_window::guiwin, input_window, gui_download_window::lbl_file, MAX_SLEN_LBL_FILE, messages_get(), NSATARI_DOWNLOAD_ERROR, NSLOG, and gui_download_window::status.

Here is the call graph for this function:

◆ on_abort_click()

static void on_abort_click ( struct gui_download_window dw)
static

Definition at line 169 of file download.c.

References gui_download_window::abort, gui_download_window::guiwin, NSATARI_DOWNLOAD_CANCELED, NSATARI_DOWNLOAD_COMPLETE, NSATARI_DOWNLOAD_ERROR, and gui_download_window::status.

Referenced by on_aes_event().

Here is the caller graph for this function:

◆ on_aes_event()

static short on_aes_event ( GUIWIN *  win,
EVMULT_OUT *  ev_out,
short  msg[8] 
)
static

Definition at line 67 of file download.c.

References clip(), on_abort_click(), on_cbrdy_click(), on_close(), on_redraw(), and gui_download_window::win.

Referenced by gui_download_window_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_cbrdy_click()

static void on_cbrdy_click ( struct gui_download_window dw)
static

Definition at line 180 of file download.c.

References gui_download_window::close_on_finish, gui_download_window::guiwin, NSATARI_DOWNLOAD_COMPLETE, and gui_download_window::status.

Referenced by on_aes_event().

Here is the caller graph for this function:

◆ on_close()

static void on_close ( struct gui_download_window dw)
static

Definition at line 190 of file download.c.

References gui_download_window_destroy().

Referenced by on_aes_event().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_redraw()

static void on_redraw ( struct gui_download_window dw,
GRECT *  clip 
)
static

Definition at line 125 of file download.c.

References gui_download_window::aes_handle, clip(), gui_download_window::close_on_finish, DOWNLOAD_BAR_MAX, gui_download_window::guiwin, gui_download_window::lbl_done, gui_download_window::lbl_file, gui_download_window::lbl_percent, gui_download_window::lbl_speed, MIN, gui_download_window::size_downloaded, gui_download_window::size_total, and gui_download_window::tree.

Referenced by on_aes_event(), and toolbar_redraw_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ select_filepath()

static char * select_filepath ( const char *  path,
const char *  filename 
)
static

Definition at line 221 of file download.c.

References gui_download_window::filename, messages_get(), path(), and PATH_MAX.

Referenced by gui_download_window_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toolbar_redraw_cb()

static void toolbar_redraw_cb ( GUIWIN *  win,
uint16_t  msg,
GRECT *  clip 
)
static

Definition at line 54 of file download.c.

References clip(), on_redraw(), and gui_download_window::win.

Referenced by gui_download_window_create().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ atari_download_table

struct gui_download_table* atari_download_table = &download_table

Definition at line 453 of file download.c.

Referenced by main().

◆ desk_area

GRECT desk_area
extern

Definition at line 79 of file gui.c.

Referenced by gui_download_window_create().

◆ download_table

struct gui_download_table download_table
static
Initial value:
= {
}
static nserror gui_download_window_data(struct gui_download_window *dw, const char *data, unsigned int size)
Definition: download.c:355
static void gui_download_window_error(struct gui_download_window *dw, const char *error_msg)
Definition: download.c:407
static void gui_download_window_done(struct gui_download_window *dw)
Definition: download.c:419
static struct gui_download_window * gui_download_window_create(download_context *ctx, struct gui_window *parent)
Definition: download.c:245

Definition at line 446 of file download.c.

◆ input_window

struct gui_window* input_window
extern

Definition at line 74 of file gui.c.

Referenced by gui_download_window_done(), and gui_download_window_error().