NetSurf
Macros | Functions
prefs.c File Reference

win32 preferences dialog implementation. More...

#include "utils/config.h"
#include <windows.h>
#include <commctrl.h>
#include "utils/nsoption.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/file.h"
#include "windows/gui.h"
#include "windows/prefs.h"
#include "windows/resourceid.h"
#include "windows/windbg.h"
Include dependency graph for prefs.c:

Go to the source code of this file.

Macros

#define NSWS_PREFS_WINDOW_WIDTH   600
 Preferences dialog width. More...
 
#define NSWS_PREFS_WINDOW_HEIGHT   400
 Preferences dialog height. More...
 

Functions

static CHOOSEFONT * nsws_prefs_font_prepare (int fontfamily, HWND parent)
 Prepare preferences dialog font tab. More...
 
static void change_spinner (HWND sub, double change, double minval, double maxval)
 Update value in spinner control when it is changed. More...
 
static BOOL CALLBACK options_appearance_dialog_handler (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lParam)
 Handle messages to the appearance preference dialog. More...
 
static BOOL CALLBACK options_connections_dialog_handler (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lParam)
 Handle messages to the connections preference dialog. More...
 
static BOOL CALLBACK options_general_dialog_handler (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lParam)
 Handle messages to the general preference dialog. More...
 
nserror nsws_prefs_save (void)
 Save the users preferances. More...
 
void nsws_prefs_dialog_init (HINSTANCE hinst, HWND parent)
 open the preferences dialog and respond to user. More...
 

Detailed Description

win32 preferences dialog implementation.

Definition in file prefs.c.

Macro Definition Documentation

◆ NSWS_PREFS_WINDOW_HEIGHT

#define NSWS_PREFS_WINDOW_HEIGHT   400

Preferences dialog height.

Definition at line 42 of file prefs.c.

◆ NSWS_PREFS_WINDOW_WIDTH

#define NSWS_PREFS_WINDOW_WIDTH   600

Preferences dialog width.

Definition at line 40 of file prefs.c.

Function Documentation

◆ change_spinner()

static void change_spinner ( HWND  sub,
double  change,
double  minval,
double  maxval 
)
static

Update value in spinner control when it is changed.

Parameters
subThe window handle of the spinner control
changeThe amount the control changed by
minvalThe minimum allowed value of the control
maxvalThe maximum allowed value of the control

Definition at line 108 of file prefs.c.

References max, and min.

Referenced by options_appearance_dialog_handler(), and options_connections_dialog_handler().

Here is the caller graph for this function:

◆ nsws_prefs_dialog_init()

void nsws_prefs_dialog_init ( HINSTANCE  hinst,
HWND  parent 
)

open the preferences dialog and respond to user.

Definition at line 689 of file prefs.c.

References hinst, IDD_OPTIONS_APPERANCE, IDD_OPTIONS_CONNECTIONS, IDD_OPTIONS_GENERAL, IDR_NETSURF_ICON, nsws_prefs_save(), options_appearance_dialog_handler(), options_connections_dialog_handler(), options_general_dialog_handler(), parent, and win_perror().

Referenced by nsws_window_command().

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

◆ nsws_prefs_font_prepare()

static CHOOSEFONT * nsws_prefs_font_prepare ( int  fontfamily,
HWND  parent 
)
static

Prepare preferences dialog font tab.

Parameters
fontfamilyThe font family
parentThe parent window win32 handle
Returns
The selected font or NULL on error

Definition at line 52 of file prefs.c.

References messages_get(), nsoption_charp, parent, and win32_warning().

Referenced by options_appearance_dialog_handler().

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

◆ nsws_prefs_save()

nserror nsws_prefs_save ( void  )

Save the users preferances.

Definition at line 673 of file prefs.c.

References G_config_path, netsurf_mkpath(), NSERROR_OK, and nsoption_write().

Referenced by nsws_prefs_dialog_init(), and nsws_window_command().

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

◆ options_appearance_dialog_handler()

static BOOL CALLBACK options_appearance_dialog_handler ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lParam 
)
static

Handle messages to the appearance preference dialog.

Parameters
hwndThe win32 handle of the appearance dialog
msgThe message code
wparamThe message w parameter
lParamThe message l parameter
Returns
result appropriate for message

Definition at line 148 of file prefs.c.

References change_spinner(), IDC_PREFS_CURSIVE, IDC_PREFS_FANTASY, IDC_PREFS_FETCH_HANDLES, IDC_PREFS_FETCH_HOST, IDC_PREFS_FETCHERS, IDC_PREFS_FONT_MINSIZE, IDC_PREFS_FONT_MINSIZE_SPIN, IDC_PREFS_FONT_SIZE, IDC_PREFS_FONT_SIZE_SPIN, IDC_PREFS_FONTDEF, IDC_PREFS_MONO, IDC_PREFS_NOANIMATION, IDC_PREFS_PROXYTYPE, IDC_PREFS_SANS, IDC_PREFS_SERIF, LOG_WIN_MSG, NSLOG, nsoption_bool, nsoption_charp, nsoption_int, nsoption_set_bool, nsoption_set_charp, nsoption_set_int, and nsws_prefs_font_prepare().

Referenced by nsws_prefs_dialog_init().

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

◆ options_connections_dialog_handler()

static BOOL CALLBACK options_connections_dialog_handler ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lParam 
)
static

Handle messages to the connections preference dialog.

Parameters
hwndThe win32 handle of the connections dialog
msgThe message code
wparamThe message w parameter
lParamThe message l parameter
Returns
result appropriate for message

Definition at line 431 of file prefs.c.

References change_spinner(), IDC_PREFS_FETCH_HANDLES, IDC_PREFS_FETCH_HANDLES_SPIN, IDC_PREFS_FETCH_HOST, IDC_PREFS_FETCH_HOST_SPIN, IDC_PREFS_FETCHERS, IDC_PREFS_FETCHERS_SPIN, IDC_PREFS_PROXYHOST, IDC_PREFS_PROXYNAME, IDC_PREFS_PROXYPASS, IDC_PREFS_PROXYPORT, IDC_PREFS_PROXYTYPE, LOG_WIN_MSG, nsoption_bool, nsoption_charp, nsoption_int, nsoption_set_charp, and nsoption_set_int.

Referenced by nsws_prefs_dialog_init().

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

◆ options_general_dialog_handler()

static BOOL CALLBACK options_general_dialog_handler ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lParam 
)
static

Handle messages to the general preference dialog.

Parameters
hwndThe win32 handle of the general dialog
msgThe message code
wparamThe message w parameter
lParamThe message l parameter
Returns
result appropriate for message

Definition at line 602 of file prefs.c.

References IDC_PREFS_ADVERTS, IDC_PREFS_HOMEPAGE, IDC_PREFS_IMAGES, IDC_PREFS_REFERER, LOG_WIN_MSG, nsoption_bool, nsoption_charp, nsoption_set_bool, nsoption_set_charp, and text().

Referenced by nsws_prefs_dialog_init().

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