NetSurf
Data Structures | Functions | Variables
download.c File Reference

windows frontend download implementation More...

#include <limits.h>
#include "utils/inet.h"
#include <shlobj.h>
#include <windows.h>
#include "utils/sys_time.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/url.h"
#include "utils/nsurl.h"
#include "utils/utils.h"
#include "utils/string.h"
#include "content/fetch.h"
#include "netsurf/download.h"
#include "desktop/download.h"
#include "windows/download.h"
#include "windows/window.h"
#include "windows/gui.h"
#include "windows/resourceid.h"
#include "windows/schedule.h"
Include dependency graph for download.c:

Go to the source code of this file.

Data Structures

struct  gui_download_window
 context for each download. More...
 

Functions

static void nsws_download_update_label (void *p)
 
static void nsws_download_update_progress (void *p)
 
static void nsws_download_clear_data (struct gui_download_window *w)
 
static BOOL CALLBACK nsws_download_event_callback (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static bool nsws_download_window_up (struct gui_download_window *w)
 
static struct gui_download_windowgui_download_window_create (download_context *ctx, struct gui_window *gui)
 
static nserror gui_download_window_data (struct gui_download_window *w, const char *data, unsigned int size)
 
static void gui_download_window_error (struct gui_download_window *w, const char *error_msg)
 
static void gui_download_window_done (struct gui_download_window *w)
 

Variables

static bool downloading = false
 
static struct gui_download_windowdownload1
 
static struct gui_download_table download_table
 
struct gui_download_tablewin32_download_table = &download_table
 

Detailed Description

windows frontend download implementation

Todo:
The windows download functionality is very buggy this needs redoing

Definition in file download.c.

Function Documentation

◆ gui_download_window_create()

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

◆ gui_download_window_data()

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

◆ gui_download_window_done()

static void gui_download_window_done ( struct gui_download_window w)
static

Definition at line 336 of file download.c.

References downloading, gui_download_window::hwnd, and nsws_download_clear_data().

Here is the call graph for this function:

◆ gui_download_window_error()

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

Definition at line 330 of file download.c.

References NSLOG.

◆ nsws_download_clear_data()

static void nsws_download_clear_data ( struct gui_download_window w)
static

Definition at line 137 of file download.c.

References nsws_download_update_label(), nsws_download_update_progress(), gui_download_window::w, and win32_schedule().

Referenced by gui_download_window_done(), and nsws_download_event_callback().

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

◆ nsws_download_event_callback()

static BOOL CALLBACK nsws_download_event_callback ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 159 of file download.c.

References download1, gui_download_window::downloaded, downloading, fallthrough, gui_download_window::hwnd, nsws_download_clear_data(), nsws_download_update_label(), nsws_download_update_progress(), and gui_download_window::size.

Referenced by nsws_download_window_up().

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

◆ nsws_download_update_label()

static void nsws_download_update_label ( void *  p)
static

Definition at line 72 of file download.c.

References human_friendly_bytesize(), IDC_DOWNLOAD_LABEL, messages_get(), nsws_download_update_label(), gui_download_window::size, SLEN, gui_download_window::w, and win32_schedule().

Referenced by nsws_download_clear_data(), nsws_download_event_callback(), and nsws_download_update_label().

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

◆ nsws_download_update_progress()

static void nsws_download_update_progress ( void *  p)
static

Definition at line 122 of file download.c.

References IDC_DOWNLOAD_PROGRESS, nsws_download_update_progress(), gui_download_window::w, and win32_schedule().

Referenced by nsws_download_clear_data(), nsws_download_event_callback(), and nsws_download_update_progress().

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

◆ nsws_download_window_up()

static bool nsws_download_window_up ( struct gui_download_window w)
static

Definition at line 186 of file download.c.

References gui_window_main_window(), hinst, IDD_DOWNLOAD, nsws_download_event_callback(), ShowWindow, and gui_download_window::w.

Referenced by gui_download_window_create().

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

Variable Documentation

◆ download1

struct gui_download_window* download1
static

Definition at line 69 of file download.c.

Referenced by gui_download_window_create(), and nsws_download_event_callback().

◆ download_table

struct gui_download_table download_table
static
Initial value:
= {
}
static nserror gui_download_window_data(struct gui_download_window *w, const char *data, unsigned int size)
Definition: download.c:309
static struct gui_download_window * gui_download_window_create(download_context *ctx, struct gui_window *gui)
Definition: download.c:201
static void gui_download_window_done(struct gui_download_window *w)
Definition: download.c:336
static void gui_download_window_error(struct gui_download_window *w, const char *error_msg)
Definition: download.c:330

Definition at line 346 of file download.c.

◆ downloading

bool downloading = false
static

◆ win32_download_table

struct gui_download_table* win32_download_table = &download_table

Definition at line 353 of file download.c.

Referenced by WinMain().