NetSurf
Macros | Functions | Variables
settings.c File Reference
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <limits.h>
#include <unistd.h>
#include <string.h>
#include <stdbool.h>
#include <cflib.h>
#include <gem.h>
#include "utils/dirent.h"
#include "utils/nsoption.h"
#include "utils/log.h"
#include "utils/utils.h"
#include "netsurf/plot_style.h"
#include "atari/gui.h"
#include "atari/res/netsurf.rsh"
#include "atari/settings.h"
#include "atari/deskmenu.h"
#include "atari/misc.h"
#include "atari/plot/plot.h"
#include "atari/bitmap.h"
#include "atari/findfile.h"
#include "atari/gemtk/gemtk.h"
Include dependency graph for settings.c:

Go to the source code of this file.

Macros

#define OBJ_SELECTED(idx)   ((bool)((dlgtree[idx].ob_state & OS_SELECTED)!=0))
 
#define OBJ_CHECK(idx)   (dlgtree[idx].ob_state |= (OS_SELECTED));
 
#define OBJ_UNCHECK(idx)   (dlgtree[idx].ob_state &= ~(OS_SELECTED));
 
#define OBJ_REDRAW(idx)
 
#define DISABLE_OBJ(idx)
 
#define ENABLE_OBJ(idx)
 
#define FORMEVENT(idx)   form_event(idx, 0);
 
#define INPUT_HOMEPAGE_URL_MAX_LEN   44
 
#define INPUT_LOCALE_MAX_LEN   6
 
#define INPUT_PROXY_HOST_MAX_LEN   31
 
#define INPUT_PROXY_USERNAME_MAX_LEN   36
 
#define INPUT_PROXY_PASSWORD_MAX_LEN   36
 
#define INPUT_PROXY_PORT_MAX_LEN   5
 
#define INPUT_MIN_REFLOW_PERIOD_MAX_LEN   4
 
#define LABEL_FONT_RENDERER_MAX_LEN   8
 
#define LABEL_PATH_MAX_LEN   40
 
#define LABEL_ICONSET_MAX_LEN   8
 
#define INPUT_TOOLBAR_COLOR_MAX_LEN   6
 

Functions

static void display_settings (void)
 
static void form_event (int index, int external)
 
static void apply_settings (void)
 
static void save_settings (void)
 
static void set_text (short idx, char *text, int len)
 
static void toggle_objects (void)
 Toogle all objects which are directly influenced by other GUI elements ( like checkbox ) More...
 
static char ** read_locales (void)
 
static void handle_filesystem_select_button (short rsc_bt)
 
static short on_aes_event (GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
 
void open_settings (void)
 
void close_settings (void)
 

Variables

char options [PATH_MAX]
 
GRECT desk_area
 
static unsigned tmp_option_memory_cache_size
 
static unsigned int tmp_option_disc_cache_size
 
static unsigned int tmp_option_expire_url
 
static unsigned int tmp_option_disc_cache_age
 
static unsigned int tmp_option_font_min_size
 
static unsigned int tmp_option_font_size
 
static unsigned int tmp_option_min_reflow_period
 
static unsigned int tmp_option_max_fetchers
 
static unsigned int tmp_option_max_fetchers_per_host
 
static unsigned int tmp_option_max_cached_fetch_handles
 
static int num_locales = 0
 
static char ** locales = NULL
 
static short h_aes_win = 0
 
static GUIWIN * settings_guiwin = NULL
 
static OBJECT * dlgtree
 
static const char * font_engines []
 
static const char * gui_timeouts []
 

Macro Definition Documentation

◆ DISABLE_OBJ

#define DISABLE_OBJ (   idx)
Value:
(dlgtree[idx].ob_state |= OS_DISABLED); \
gemtk_wm_exec_redraw(settings_guiwin, \
gemtk_obj_screen_rect(dlgtree, idx));
static GUIWIN * settings_guiwin
Definition: settings.c:65
static OBJECT * dlgtree
Definition: settings.c:66

Definition at line 98 of file settings.c.

◆ ENABLE_OBJ

#define ENABLE_OBJ (   idx)
Value:
(dlgtree[idx].ob_state &= ~(OS_DISABLED)); \
gemtk_wm_exec_redraw(settings_guiwin, \
gemtk_obj_screen_rect(dlgtree, idx));

Definition at line 102 of file settings.c.

◆ FORMEVENT

#define FORMEVENT (   idx)    form_event(idx, 0);

Definition at line 106 of file settings.c.

◆ INPUT_HOMEPAGE_URL_MAX_LEN

#define INPUT_HOMEPAGE_URL_MAX_LEN   44

Definition at line 108 of file settings.c.

◆ INPUT_LOCALE_MAX_LEN

#define INPUT_LOCALE_MAX_LEN   6

Definition at line 109 of file settings.c.

◆ INPUT_MIN_REFLOW_PERIOD_MAX_LEN

#define INPUT_MIN_REFLOW_PERIOD_MAX_LEN   4

Definition at line 114 of file settings.c.

◆ INPUT_PROXY_HOST_MAX_LEN

#define INPUT_PROXY_HOST_MAX_LEN   31

Definition at line 110 of file settings.c.

◆ INPUT_PROXY_PASSWORD_MAX_LEN

#define INPUT_PROXY_PASSWORD_MAX_LEN   36

Definition at line 112 of file settings.c.

◆ INPUT_PROXY_PORT_MAX_LEN

#define INPUT_PROXY_PORT_MAX_LEN   5

Definition at line 113 of file settings.c.

◆ INPUT_PROXY_USERNAME_MAX_LEN

#define INPUT_PROXY_USERNAME_MAX_LEN   36

Definition at line 111 of file settings.c.

◆ INPUT_TOOLBAR_COLOR_MAX_LEN

#define INPUT_TOOLBAR_COLOR_MAX_LEN   6

Definition at line 118 of file settings.c.

◆ LABEL_FONT_RENDERER_MAX_LEN

#define LABEL_FONT_RENDERER_MAX_LEN   8

Definition at line 115 of file settings.c.

◆ LABEL_ICONSET_MAX_LEN

#define LABEL_ICONSET_MAX_LEN   8

Definition at line 117 of file settings.c.

◆ LABEL_PATH_MAX_LEN

#define LABEL_PATH_MAX_LEN   40

Definition at line 116 of file settings.c.

◆ OBJ_CHECK

#define OBJ_CHECK (   idx)    (dlgtree[idx].ob_state |= (OS_SELECTED));

Definition at line 91 of file settings.c.

◆ OBJ_REDRAW

#define OBJ_REDRAW (   idx)
Value:
gemtk_wm_exec_redraw(settings_guiwin, \
gemtk_obj_screen_rect(dlgtree, idx));

Definition at line 95 of file settings.c.

◆ OBJ_SELECTED

#define OBJ_SELECTED (   idx)    ((bool)((dlgtree[idx].ob_state & OS_SELECTED)!=0))

Definition at line 89 of file settings.c.

◆ OBJ_UNCHECK

#define OBJ_UNCHECK (   idx)    (dlgtree[idx].ob_state &= ~(OS_SELECTED));

Definition at line 93 of file settings.c.

Function Documentation

◆ apply_settings()

static void apply_settings ( void  )
static

Definition at line 754 of file settings.c.

References dlgtree, nsoption_set_bool, nsoption_set_charp, nsoption_set_int, OBJ_SELECTED, OPTION_HTTP_PROXY_AUTH_BASIC, OPTION_HTTP_PROXY_AUTH_NONE, tmp_option_disc_cache_age, tmp_option_disc_cache_size, tmp_option_expire_url, tmp_option_font_min_size, tmp_option_font_size, tmp_option_memory_cache_size, and tmp_option_min_reflow_period.

Referenced by save_settings().

Here is the caller graph for this function:

◆ close_settings()

void close_settings ( void  )

Definition at line 952 of file settings.c.

References h_aes_win, NSLOG, and settings_guiwin.

Referenced by on_aes_event(), and save_settings().

Here is the caller graph for this function:

◆ display_settings()

static void display_settings ( void  )
static

◆ form_event()

static void form_event ( int  index,
int  external 
)
static

Definition at line 424 of file settings.c.

References DISABLE_OBJ, dlgtree, ENABLE_OBJ, font_engines, FORMEVENT, gui_timeouts, handle_filesystem_select_button(), LABEL_FONT_RENDERER_MAX_LEN, locales, NOF_ELEMENTS, num_locales, OBJ_REDRAW, OBJ_SELECTED, OBJ_UNCHECK, read_locales(), set_text(), tmp_option_disc_cache_age, tmp_option_disc_cache_size, tmp_option_expire_url, tmp_option_font_min_size, tmp_option_font_size, tmp_option_max_cached_fetch_handles, tmp_option_max_fetchers, tmp_option_max_fetchers_per_host, tmp_option_memory_cache_size, and tmp_option_min_reflow_period.

Referenced by on_aes_event().

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

◆ handle_filesystem_select_button()

static void handle_filesystem_select_button ( short  rsc_bt)
static

Definition at line 351 of file settings.c.

References dlgtree, file_select(), is_dir(), OBJ_REDRAW, OBJ_UNCHECK, and path().

Referenced by form_event().

Here is the call graph for this function:
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 849 of file settings.c.

References close_settings(), form_event(), and save_settings().

Referenced by open_settings().

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

◆ open_settings()

void open_settings ( void  )

Definition at line 904 of file settings.c.

References desk_area, display_settings(), dlgtree, h_aes_win, MIN, on_aes_event(), and settings_guiwin.

Referenced by menu_choices().

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

◆ read_locales()

static char ** read_locales ( void  )
static

Definition at line 158 of file settings.c.

References atari_find_resource(), atari_warn_user(), locales, NSLOG, num_locales, and PATH_MAX.

Referenced by form_event().

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

◆ save_settings()

static void save_settings ( void  )
static

Definition at line 203 of file settings.c.

References apply_settings(), close_settings(), deskmenu_update(), nsoption_read(), nsoption_write(), and options.

Referenced by on_aes_event().

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

◆ set_text()

static void set_text ( short  idx,
char *  text,
int  len 
)
static

Definition at line 127 of file settings.c.

References dlgtree, and text().

Referenced by display_settings(), and form_event().

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

◆ toggle_objects()

static void toggle_objects ( void  )
static

Toogle all objects which are directly influenced by other GUI elements ( like checkbox )

Definition at line 149 of file settings.c.

References FORMEVENT.

Referenced by display_settings().

Here is the caller graph for this function:

Variable Documentation

◆ desk_area

GRECT desk_area
extern

Definition at line 78 of file gui.c.

Referenced by gui_init(), open_settings(), and process_cmdline().

◆ dlgtree

OBJECT* dlgtree
static

◆ font_engines

const char* font_engines[]
static
Initial value:
= {
}

Definition at line 69 of file settings.c.

Referenced by form_event().

◆ gui_timeouts

const char* gui_timeouts[]
static
Initial value:
= {
"0", "5", "10"
}

Definition at line 85 of file settings.c.

Referenced by form_event().

◆ h_aes_win

short h_aes_win = 0
static

Definition at line 64 of file settings.c.

Referenced by close_settings(), and open_settings().

◆ locales

char** locales = NULL
static

Definition at line 63 of file settings.c.

Referenced by form_event(), and read_locales().

◆ num_locales

int num_locales = 0
static

Definition at line 62 of file settings.c.

Referenced by form_event(), and read_locales().

◆ options

char options[PATH_MAX]
extern

Definition at line 90 of file gui.c.

Referenced by main(), and save_settings().

◆ settings_guiwin

GUIWIN* settings_guiwin = NULL
static

Definition at line 65 of file settings.c.

Referenced by close_settings(), and open_settings().

◆ tmp_option_disc_cache_age

unsigned int tmp_option_disc_cache_age
static

Definition at line 54 of file settings.c.

Referenced by apply_settings(), display_settings(), and form_event().

◆ tmp_option_disc_cache_size

unsigned int tmp_option_disc_cache_size
static

Definition at line 52 of file settings.c.

Referenced by apply_settings(), display_settings(), and form_event().

◆ tmp_option_expire_url

unsigned int tmp_option_expire_url
static

Definition at line 53 of file settings.c.

Referenced by apply_settings(), display_settings(), and form_event().

◆ tmp_option_font_min_size

unsigned int tmp_option_font_min_size
static

Definition at line 55 of file settings.c.

Referenced by apply_settings(), display_settings(), and form_event().

◆ tmp_option_font_size

unsigned int tmp_option_font_size
static

Definition at line 56 of file settings.c.

Referenced by apply_settings(), display_settings(), and form_event().

◆ tmp_option_max_cached_fetch_handles

unsigned int tmp_option_max_cached_fetch_handles
static

Definition at line 60 of file settings.c.

Referenced by display_settings(), and form_event().

◆ tmp_option_max_fetchers

unsigned int tmp_option_max_fetchers
static

Definition at line 58 of file settings.c.

Referenced by display_settings(), and form_event().

◆ tmp_option_max_fetchers_per_host

unsigned int tmp_option_max_fetchers_per_host
static

Definition at line 59 of file settings.c.

Referenced by display_settings(), and form_event().

◆ tmp_option_memory_cache_size

unsigned tmp_option_memory_cache_size
static

Definition at line 51 of file settings.c.

Referenced by apply_settings(), display_settings(), and form_event().

◆ tmp_option_min_reflow_period

unsigned int tmp_option_min_reflow_period
static

Definition at line 57 of file settings.c.

Referenced by apply_settings(), display_settings(), and form_event().