NetSurf
Data Structures | Macros | Functions | Variables
401login.c File Reference
#include "utils/config.h"
#include <assert.h>
#include <stdbool.h>
#include <string.h>
#include <oslib/wimp.h>
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/nsurl.h"
#include "netsurf/url_db.h"
#include "riscos/gui.h"
#include "riscos/dialog.h"
#include "riscos/wimp_event.h"
Include dependency graph for 401login.c:

Go to the source code of this file.

Data Structures

struct  session_401
 login window session data More...
 

Macros

#define ICON_401LOGIN_LOGIN   0
 
#define ICON_401LOGIN_CANCEL   1
 
#define ICON_401LOGIN_HOST   2
 
#define ICON_401LOGIN_REALM   3
 
#define ICON_401LOGIN_USERNAME   4
 
#define ICON_401LOGIN_PASSWORD   5
 

Functions

static void ro_gui_401login_close (wimp_w w)
 Handle closing of login dialog. More...
 
static bool ro_gui_401login_apply (wimp_w w)
 
static nserror ro_gui_401login_open (nsurl *url, lwc_string *host, const char *realm, const char *username, const char *password, nserror(*cb)(const char *username, const char *password, void *pw), void *cbpw)
 Open a 401 login window. More...
 
void ro_gui_401login_init (void)
 Load the 401 login window template. More...
 
nserror gui_401login_open (nsurl *url, const char *realm, const char *username, const char *password, nserror(*cb)(const char *username, const char *password, void *pw), void *cbpw)
 Open the login dialog. More...
 

Variables

static wimp_window * dialog_401_template
 

Macro Definition Documentation

◆ ICON_401LOGIN_CANCEL

#define ICON_401LOGIN_CANCEL   1

Definition at line 36 of file 401login.c.

Referenced by ro_gui_401login_open().

◆ ICON_401LOGIN_HOST

#define ICON_401LOGIN_HOST   2

Definition at line 37 of file 401login.c.

Referenced by ro_gui_401login_open().

◆ ICON_401LOGIN_LOGIN

#define ICON_401LOGIN_LOGIN   0

Definition at line 35 of file 401login.c.

Referenced by ro_gui_401login_open().

◆ ICON_401LOGIN_PASSWORD

#define ICON_401LOGIN_PASSWORD   5

Definition at line 40 of file 401login.c.

Referenced by ro_gui_401login_open().

◆ ICON_401LOGIN_REALM

#define ICON_401LOGIN_REALM   3

Definition at line 38 of file 401login.c.

Referenced by ro_gui_401login_open().

◆ ICON_401LOGIN_USERNAME

#define ICON_401LOGIN_USERNAME   4

Definition at line 39 of file 401login.c.

Referenced by ro_gui_401login_open().

Function Documentation

◆ gui_401login_open()

nserror gui_401login_open ( nsurl url,
const char *  realm,
const char *  username,
const char *  password,
nserror(*)(const char *username, const char *password, void *pw)  cb,
void *  cbpw 
)

◆ ro_gui_401login_apply()

bool ro_gui_401login_apply ( wimp_w  w)
static

Definition at line 219 of file 401login.c.

References session_401::cb, session_401::cbpw, session_401::pwd, ro_gui_wimp_event_get_user_data(), and session_401::uname.

Referenced by ro_gui_401login_open().

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

◆ ro_gui_401login_close()

void ro_gui_401login_close ( wimp_w  w)
static

Handle closing of login dialog.

Definition at line 188 of file 401login.c.

References session_401::cb, session_401::cbpw, session_401::host, NSLOG, nsurl_unref(), session_401::realm, ro_gui_wimp_event_finalise(), ro_gui_wimp_event_get_user_data(), ro_warn_user(), and session_401::url.

Referenced by ro_gui_401login_open().

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

◆ ro_gui_401login_init()

void ro_gui_401login_init ( void  )

Load the 401 login window template.

Definition at line 71 of file 401login.c.

References ro_gui_dialog_load_template().

Referenced by ro_gui_dialog_init().

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

◆ ro_gui_401login_open()

nserror ro_gui_401login_open ( nsurl url,
lwc_string *  host,
const char *  realm,
const char *  username,
const char *  password,
nserror(*)(const char *username, const char *password, void *pw)  cb,
void *  cbpw 
)
static

Open a 401 login window.

Definition at line 103 of file 401login.c.

References session_401::cb, session_401::cbpw, session_401::host, ICON_401LOGIN_CANCEL, ICON_401LOGIN_HOST, ICON_401LOGIN_LOGIN, ICON_401LOGIN_PASSWORD, ICON_401LOGIN_REALM, ICON_401LOGIN_USERNAME, NSERROR_NOMEM, NSERROR_OK, nsurl_ref(), nsurl_unref(), session_401::pwd, session_401::realm, ro_gui_401login_apply(), ro_gui_401login_close(), ro_gui_dialog_open_persistent(), ro_gui_wimp_event_register_cancel(), ro_gui_wimp_event_register_close_window(), ro_gui_wimp_event_register_ok(), ro_gui_wimp_event_register_text_field(), ro_gui_wimp_event_set_user_data(), ro_warn_user(), session_401::uname, and session_401::url.

Referenced by gui_401login_open().

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

Variable Documentation

◆ dialog_401_template

wimp_window* dialog_401_template
static

Definition at line 52 of file 401login.c.