change all core and frontend options headers to new format

This commit is contained in:
Vincent Sanders 2013-05-27 09:36:26 +01:00
parent c1e864656d
commit a5355ec557
8 changed files with 499 additions and 763 deletions

View File

@ -16,207 +16,77 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _NETSURF_DESKTOP_OPTIONS_INCLUDING_
#error "Frontend options header cannot be included directly"
#endif
#ifndef AMIGA_OPTIONS_H
#define AMIGA_OPTIONS_H
#define NSOPTION_EXTRA_DEFINE \
char *url_file; \
char *hotlist_file; \
char *use_pubscreen; \
char *modeid; \
int screen_compositing; \
int amiga_ydpi; \
int cache_bitmaps; \
char *theme; \
bool utf8_clipboard; \
bool context_menu; \
bool truecolour_mouse_pointers; \
bool use_os_pointers; \
bool use_openurl_lib; \
bool new_tab_active; \
bool new_tab_last; \
bool tab_close_warn; \
bool tab_always_show; \
bool kiosk_mode; \
char *search_engines_file; \
char *arexx_dir; \
char *arexx_startup; \
char *arexx_shutdown; \
char *download_dir; \
bool download_notify; \
bool faster_scroll; \
bool scale_quality; \
int dither_quality; \
int mask_alpha; \
bool ask_overwrite; \
int printer_unit; \
int print_scale; \
bool startup_no_window; \
bool close_no_quit; \
bool hide_docky_icon; \
char *font_unicode; \
char *font_unicode_file; \
bool font_unicode_only; \
bool font_antialiasing; \
bool drag_save_icons; \
int hotlist_window_xpos; \
int hotlist_window_ypos; \
int hotlist_window_xsize; \
int hotlist_window_ysize; \
int history_window_xpos; \
int history_window_ypos; \
int history_window_xsize; \
int history_window_ysize; \
int cookies_window_xpos; \
int cookies_window_ypos; \
int cookies_window_xsize; \
int cookies_window_ysize; \
int web_search_width; \
int cairo_renderer; \
bool direct_render; \
bool window_simple_refresh; \
bool resize_with_contents; \
int reformat_delay; \
int redraw_tile_size_x; \
int redraw_tile_size_y; \
int monitor_aspect_x; \
int monitor_aspect_y; \
bool accept_lang_locale; \
int menu_refresh
#define NSOPTION_EXTRA_DEFAULTS \
.url_file = NULL, \
.hotlist_file = NULL, \
.use_pubscreen = NULL, \
.modeid = NULL, \
.screen_compositing = -1, \
.amiga_ydpi = 85, \
.cache_bitmaps = 0, \
.theme = NULL, \
.utf8_clipboard = false, \
.context_menu = true, \
.truecolour_mouse_pointers = false, \
.use_os_pointers = true, \
.use_openurl_lib = false, \
.new_tab_active = false, \
.new_tab_last = false, \
.tab_close_warn = true, \
.tab_always_show = false, \
.kiosk_mode = false, \
.search_engines_file = NULL, \
.arexx_dir = NULL, \
.arexx_startup = NULL, \
.arexx_shutdown = NULL, \
.download_dir = NULL, \
.download_notify = false, \
.faster_scroll = true, \
.scale_quality = false, \
.dither_quality = 1, \
.mask_alpha = 50, \
.ask_overwrite = true, \
.printer_unit = 0, \
.print_scale = 100, \
.startup_no_window = false, \
.close_no_quit = false, \
.hide_docky_icon = false, \
.font_unicode = NULL, \
.font_unicode_file = NULL, \
.font_unicode_only = false, \
.font_antialiasing = true, \
.drag_save_icons = true, \
.hotlist_window_xpos = 0, \
.hotlist_window_ypos = 0, \
.hotlist_window_xsize = 0, \
.hotlist_window_ysize = 0, \
.history_window_xpos = 0, \
.history_window_ypos = 0, \
.history_window_xsize = 0, \
.history_window_ysize = 0, \
.cookies_window_xpos = 0, \
.cookies_window_ypos = 0, \
.cookies_window_xsize = 0, \
.cookies_window_ysize = 0, \
.web_search_width = 0, \
.cairo_renderer = 0, \
.direct_render = false, \
.window_simple_refresh = false, \
.resize_with_contents = false, \
.reformat_delay = 0, \
.redraw_tile_size_x = 0, \
.redraw_tile_size_y = 0, \
.monitor_aspect_x = 0, \
.monitor_aspect_y = 0, \
.accept_lang_locale = true, \
.menu_refresh = 0
#define NSOPTION_EXTRA_TABLE \
{ "url_file", OPTION_STRING, &nsoptions.url_file }, \
{ "hotlist_file", OPTION_STRING, &nsoptions.hotlist_file }, \
{ "use_pubscreen", OPTION_STRING, &nsoptions.use_pubscreen}, \
{ "screen_modeid", OPTION_STRING, &nsoptions.modeid}, \
{ "screen_compositing", OPTION_INTEGER, &nsoptions.screen_compositing}, \
{ "screen_ydpi", OPTION_INTEGER, &nsoptions.amiga_ydpi}, \
{ "cache_bitmaps", OPTION_INTEGER, &nsoptions.cache_bitmaps}, \
{ "theme", OPTION_STRING, &nsoptions.theme}, \
{ "clipboard_write_utf8", OPTION_BOOL, &nsoptions.utf8_clipboard}, \
{ "context_menu", OPTION_BOOL, &nsoptions.context_menu}, \
{ "truecolour_mouse_pointers", OPTION_BOOL, &nsoptions.truecolour_mouse_pointers}, \
{ "os_mouse_pointers", OPTION_BOOL, &nsoptions.use_os_pointers}, \
{ "use_openurl_lib", OPTION_BOOL, &nsoptions.use_openurl_lib}, \
{ "new_tab_is_active", OPTION_BOOL, &nsoptions.new_tab_active}, \
{ "new_tab_last", OPTION_BOOL, &nsoptions.new_tab_last}, \
{ "tab_close_warn", OPTION_BOOL, &nsoptions.tab_close_warn}, \
{ "tab_always_show", OPTION_BOOL, &nsoptions.tab_always_show}, \
{ "kiosk_mode", OPTION_BOOL, &nsoptions.kiosk_mode}, \
{ "search_engines_file",OPTION_STRING, &nsoptions.search_engines_file }, \
{ "arexx_dir", OPTION_STRING, &nsoptions.arexx_dir }, \
{ "arexx_startup", OPTION_STRING, &nsoptions.arexx_startup }, \
{ "arexx_shutdown", OPTION_STRING, &nsoptions.arexx_shutdown }, \
{ "download_dir", OPTION_STRING, &nsoptions.download_dir }, \
{ "download_notify", OPTION_BOOL, &nsoptions.download_notify}, \
{ "faster_scroll", OPTION_BOOL, &nsoptions.faster_scroll}, \
{ "scale_quality", OPTION_BOOL, &nsoptions.scale_quality}, \
{ "dither_quality", OPTION_INTEGER, &nsoptions.dither_quality}, \
{ "mask_alpha", OPTION_INTEGER, &nsoptions.mask_alpha}, \
{ "ask_overwrite", OPTION_BOOL, &nsoptions.ask_overwrite}, \
{ "printer_unit", OPTION_INTEGER, &nsoptions.printer_unit}, \
{ "print_scale", OPTION_INTEGER, &nsoptions.print_scale}, \
{ "startup_no_window", OPTION_BOOL, &nsoptions.startup_no_window}, \
{ "close_no_quit", OPTION_BOOL, &nsoptions.close_no_quit}, \
{ "hide_docky_icon", OPTION_BOOL, &nsoptions.hide_docky_icon}, \
{ "font_unicode", OPTION_STRING, &nsoptions.font_unicode }, \
{ "font_unicode_file", OPTION_STRING, &nsoptions.font_unicode_file }, \
{ "font_unicode_only", OPTION_BOOL, &nsoptions.font_unicode_only }, \
{ "font_antialiasing", OPTION_BOOL, &nsoptions.font_antialiasing }, \
{ "drag_save_icons", OPTION_BOOL, &nsoptions.drag_save_icons}, \
{ "hotlist_window_xpos", OPTION_INTEGER, &nsoptions.hotlist_window_xpos}, \
{ "hotlist_window_ypos", OPTION_INTEGER, &nsoptions.hotlist_window_ypos}, \
{ "hotlist_window_xsize", OPTION_INTEGER, &nsoptions.hotlist_window_xsize}, \
{ "hotlist_window_ysize", OPTION_INTEGER, &nsoptions.hotlist_window_ysize}, \
{ "history_window_xpos", OPTION_INTEGER, &nsoptions.history_window_xpos}, \
{ "history_window_ypos", OPTION_INTEGER, &nsoptions.history_window_ypos}, \
{ "history_window_xsize", OPTION_INTEGER, &nsoptions.history_window_xsize}, \
{ "history_window_ysize", OPTION_INTEGER, &nsoptions.history_window_ysize}, \
{ "cookies_window_xpos", OPTION_INTEGER, &nsoptions.cookies_window_xpos}, \
{ "cookies_window_ypos", OPTION_INTEGER, &nsoptions.cookies_window_ypos}, \
{ "cookies_window_xsize", OPTION_INTEGER, &nsoptions.cookies_window_xsize}, \
{ "cookies_window_ysize", OPTION_INTEGER, &nsoptions.cookies_window_ysize}, \
{ "web_search_width", OPTION_INTEGER, &nsoptions.web_search_width}, \
{ "cairo_renderer", OPTION_INTEGER, &nsoptions.cairo_renderer}, \
{ "direct_render", OPTION_BOOL, &nsoptions.direct_render}, \
{ "window_simple_refresh", OPTION_BOOL, &nsoptions.window_simple_refresh}, \
{ "resize_with_contents", OPTION_BOOL, &nsoptions.resize_with_contents}, \
{ "reformat_delay", OPTION_INTEGER, &nsoptions.reformat_delay}, \
{ "redraw_tile_size_x", OPTION_INTEGER, &nsoptions.redraw_tile_size_x}, \
{ "redraw_tile_size_y", OPTION_INTEGER, &nsoptions.redraw_tile_size_y}, \
{ "monitor_aspect_x", OPTION_INTEGER, &nsoptions.monitor_aspect_x}, \
{ "monitor_aspect_y", OPTION_INTEGER, &nsoptions.monitor_aspect_y}, \
{ "accept_lang_locale", OPTION_BOOL, &nsoptions.accept_lang_locale}, \
{ "menu_refresh", OPTION_INTEGER, &nsoptions.menu_refresh}
/* currently nothing here */
#endif
NSOPTION_STRING(url_file, NULL)
NSOPTION_STRING(hotlist_file, NULL)
NSOPTION_STRING(use_pubscreen, NULL)
NSOPTION_STRING(screen_modeid, NULL)
NSOPTION_INTEGER(screen_compositing, -1)
NSOPTION_INTEGER(screen_ydpi, 85)
NSOPTION_INTEGER(cache_bitmaps, 0)
NSOPTION_STRING(theme, "PROGDIR:Resources/Themes/Default")
NSOPTION_BOOL(clipboard_write_utf8, false)
NSOPTION_BOOL(context_menu, true)
NSOPTION_BOOL(truecolour_mouse_pointers, false)
NSOPTION_BOOL(os_mouse_pointers, true)
NSOPTION_BOOL(use_openurl_lib, false)
NSOPTION_BOOL(new_tab_is_active, false)
NSOPTION_BOOL(new_tab_last, false)
NSOPTION_BOOL(tab_close_warn, true)
NSOPTION_BOOL(tab_always_show, false)
NSOPTION_BOOL(kiosk_mode, false)
NSOPTION_STRING(search_engines_file, "PROGDIR:Resources/SearchEngines")
NSOPTION_STRING(arexx_dir, "Rexx")
NSOPTION_STRING(arexx_startup, "Startup.nsrx")
NSOPTION_STRING(arexx_shutdown, "Shutdown.nsrx")
NSOPTION_STRING(download_dir, NULL)
NSOPTION_BOOL(download_notify, false)
NSOPTION_BOOL(faster_scroll, true)
NSOPTION_BOOL(scale_quality, false)
NSOPTION_INTEGER(dither_quality, 1)
NSOPTION_INTEGER(mask_alpha, 50)
NSOPTION_BOOL(ask_overwrite, true)
NSOPTION_INTEGER(printer_unit, 0)
NSOPTION_INTEGER(print_scale, 100)
NSOPTION_BOOL(startup_no_window, false)
NSOPTION_BOOL(close_no_quit, false)
NSOPTION_BOOL(hide_docky_icon, false)
NSOPTION_STRING(font_unicode, NULL)
NSOPTION_STRING(font_unicode_file, NULL)
NSOPTION_BOOL(font_unicode_only, false)
NSOPTION_BOOL(font_antialiasing, true)
NSOPTION_BOOL(drag_save_icons, true)
NSOPTION_INTEGER(hotlist_window_xpos, 0)
NSOPTION_INTEGER(hotlist_window_ypos, 0)
NSOPTION_INTEGER(hotlist_window_xsize, 0)
NSOPTION_INTEGER(hotlist_window_ysize, 0)
NSOPTION_INTEGER(history_window_xpos, 0)
NSOPTION_INTEGER(history_window_ypos, 0)
NSOPTION_INTEGER(history_window_xsize, 0)
NSOPTION_INTEGER(history_window_ysize, 0)
NSOPTION_INTEGER(cookies_window_xpos, 0)
NSOPTION_INTEGER(cookies_window_ypos, 0)
NSOPTION_INTEGER(cookies_window_xsize, 0)
NSOPTION_INTEGER(cookies_window_ysize, 0)
NSOPTION_INTEGER(web_search_width, 0)
NSOPTION_INTEGER(cairo_renderer, 0)
NSOPTION_BOOL(direct_render, false)
NSOPTION_BOOL(window_simple_refresh, false)
NSOPTION_BOOL(resize_with_contents, false)
NSOPTION_INTEGER(reformat_delay, 0)
NSOPTION_INTEGER(redraw_tile_size_x, 0)
NSOPTION_INTEGER(redraw_tile_size_y, 0)
NSOPTION_INTEGER(monitor_aspect_x, 0)
NSOPTION_INTEGER(monitor_aspect_y, 0)
NSOPTION_BOOL(accept_lang_locale, true)
NSOPTION_INTEGER(menu_refresh, 0)

View File

@ -1,5 +1,5 @@
/*
* Copyright 2010 Ole Loots <ole@monochrom.net>
* Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@ -16,76 +16,32 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _NETSURF_DESKTOP_OPTIONS_INCLUDING_
#error "Frontend options header cannot be included directly"
#endif
#ifndef NS_ATARI_OPTIONS_H_
#define NS_ATARI_OPTIONS_H_
#define NSOPTION_EXTRA_DEFINE \
char *atari_font_driver; \
int atari_font_monochrom; \
int atari_dither; \
int atari_transparency; \
char *atari_face_sans_serif; /* default sans face */ \
char *atari_face_sans_serif_bold; /* bold sans face */ \
char *atari_face_sans_serif_italic; /* bold sans face */ \
char *atari_face_sans_serif_italic_bold; /* bold sans face */ \
char *atari_face_monospace; /* monospace face */ \
char *atari_face_monospace_bold; /* monospace face */ \
char *atari_face_serif; /* serif face */ \
char *atari_face_serif_bold; /* bold serif face */ \
char *atari_face_cursive; \
char *atari_face_fantasy; \
char *atari_editor; \
char *downloads_path; \
char *url_file; \
char *hotlist_file; \
char *tree_icons_path
#define NSOPTION_EXTRA_DEFAULTS \
.atari_font_driver = (char*)"freetype", \
.atari_font_monochrom = 0, \
.atari_dither = 1, \
.atari_transparency = 1, \
.atari_face_sans_serif = NULL, \
.atari_face_sans_serif_bold = NULL, \
.atari_face_sans_serif_italic = NULL, \
.atari_face_sans_serif_italic_bold = NULL, \
.atari_face_monospace = NULL, \
.atari_face_monospace_bold = NULL, \
.atari_face_serif = NULL, \
.atari_face_serif_bold = NULL, \
.atari_face_cursive = NULL, \
.atari_face_fantasy = NULL, \
.atari_editor = (char*)"", \
.downloads_path = (char*)"downloads", \
.url_file = (char*)"url.db", \
.hotlist_file = (char*)"hotlist", \
.tree_icons_path = (char*)"./res/icons"
#define NSOPTION_EXTRA_TABLE \
{ "atari_font_driver", OPTION_STRING, &nsoptions.atari_font_driver },\
{ "atari_font_monochrom", OPTION_INTEGER, &nsoptions.atari_font_monochrom },\
{ "atari_transparency", OPTION_INTEGER, &nsoptions.atari_transparency },\
{ "atari_dither", OPTION_INTEGER, &nsoptions.atari_dither },\
{ "atari_editor", OPTION_STRING, &nsoptions.atari_editor },\
{ "font_face_sans_serif", OPTION_STRING, &nsoptions.atari_face_sans_serif },\
{ "font_face_sans_serif_bold", OPTION_STRING, &nsoptions.atari_face_sans_serif_bold },\
{ "font_face_sans_serif_italic", OPTION_STRING, &nsoptions.atari_face_sans_serif_italic },\
{ "font_face_sans_serif_italic_bold", OPTION_STRING, &nsoptions.atari_face_sans_serif_italic_bold },\
{ "font_face_monospace", OPTION_STRING, &nsoptions.atari_face_monospace },\
{ "font_face_monospace_bold", OPTION_STRING, &nsoptions.atari_face_monospace_bold },\
{ "font_face_serif", OPTION_STRING, &nsoptions.atari_face_serif },\
{ "font_face_serif_bold", OPTION_STRING, &nsoptions.atari_face_serif_bold },\
{ "font_face_cursive", OPTION_STRING, &nsoptions.atari_face_cursive },\
{ "font_face_fantasy", OPTION_STRING, &nsoptions.atari_face_fantasy },\
{ "downloads_path", OPTION_STRING, &nsoptions.downloads_path },\
{ "url_file", OPTION_STRING, &nsoptions.url_file },\
{ "hotlist_file", OPTION_STRING, &nsoptions.hotlist_file },\
{ "tree_icons_path", OPTION_STRING, &nsoptions.tree_icons_path }
/* setup longer default reflow time */
#define DEFAULT_REFLOW_PERIOD 350 /* time in cs */
#endif
NSOPTION_STRING(atari_font_driver, "freetype")
NSOPTION_INTEGER(atari_font_monochrom, 0)
NSOPTION_INTEGER(atari_transparency, 1)
NSOPTION_INTEGER(atari_dither, 1)
NSOPTION_STRING(atari_editor, NULL)
NSOPTION_STRING(font_face_sans_serif, NULL)
NSOPTION_STRING(font_face_sans_serif_bold, NULL)
NSOPTION_STRING(font_face_sans_serif_italic, NULL)
NSOPTION_STRING(font_face_sans_serif_italic_bold, NULL)
NSOPTION_STRING(font_face_monospace, NULL)
NSOPTION_STRING(font_face_monospace_bold, NULL)
NSOPTION_STRING(font_face_serif, NULL)
NSOPTION_STRING(font_face_serif_bold, NULL)
NSOPTION_STRING(font_face_cursive, NULL)
NSOPTION_STRING(font_face_fantasy, NULL)
NSOPTION_STRING(downloads_path, "downloads")
NSOPTION_STRING(url_file, "url.db")
NSOPTION_STRING(hotlist_file, "hotlist")
NSOPTION_STRING(tree_icons_path, "./res/icons")

View File

@ -17,23 +17,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _NETSURF_DESKTOP_OPTIONS_INCLUDING_
#error "Frontend options header cannot be included directly"
#endif
#ifndef _NETSURF_BEOS_OPTIONS_H_
#define _NETSURF_BEOS_OPTIONS_H_
#define NSOPTION_EXTRA_DEFINE \
bool render_resample; \
char *url_file
#define NSOPTION_EXTRA_DEFAULTS \
.render_resample = false, \
.url_file = 0
#define NSOPTION_EXTRA_TABLE \
{ "render_resample", OPTION_BOOL, &nsoptions.render_resample }, \
{ "url_file", OPTION_STRING, &nsoptions.url_file }
/* currently nothing here */
#endif
NSOPTION_BOOL(render_resample, false)
NSOPTION_STRING(url_file, NULL)

View File

@ -1,6 +1,5 @@
/*
* Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
* Copyright 2004 James Bursa <bursa@users.sourceforge.net>
* Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@ -18,171 +17,258 @@
*/
/** \file
* Option reading and saving (interface).
* Option available on all platforms
*
* Non-platform specific options can be added by editing this file and
* netsurf/desktop/options.c
* Non-platform specific options can be added by editing this file
*
* Platform specific options should be added in the platform options.h.
*
* The following types of options are supported:
* - bool (OPTION_BOOL)
* - int (OPTION_INTEGER)
* - char* (OPTION_STRING) (must be allocated on heap, may be 0, free before
* assigning a new value)
* This header is specificaly intented to be included multiple times
* with different macro definitions so there is no guard
*/
#ifndef _NETSURF_DESKTOP_OPTIONS_H_
#define _NETSURF_DESKTOP_OPTIONS_H_
#define _NETSURF_DESKTOP_OPTIONS_INCLUDING_
#include <stdbool.h>
#include <stdio.h>
#include "desktop/plot_style.h"
#include "desktop/options_main.h"
#if defined(riscos)
#include "riscos/options.h"
#elif defined(nsgtk)
#include "gtk/options.h"
#elif defined(nsbeos)
#include "beos/options.h"
#elif defined(nsamiga)
#include "amiga/options.h"
#elif defined(nsframebuffer)
#include "framebuffer/options.h"
#elif defined(nsatari)
#include "atari/options.h"
#elif defined(nsmonkey)
#include "monkey/options.h"
#else
#define NSOPTION_EXTRA_DEFINE
#define NSOPTION_EXTRA_DEFAULTS
#define NSOPTION_EXTRA_TABLE
#endif
/* allow the colour defaults to be overidden by the frontends */
#ifndef NSOPTION_SYS_COLOUR_DEFAULTS
#define NSOPTION_SYS_COLOUR_DEFAULTS NSOPTION_MAIN_SYS_COLOUR_DEFAULTS
#endif
#undef _NETSURF_DESKTOP_OPTIONS_INCLUDING_
enum { OPTION_HTTP_PROXY_AUTH_NONE = 0,
OPTION_HTTP_PROXY_AUTH_BASIC = 1,
OPTION_HTTP_PROXY_AUTH_NTLM = 2 };
#define DEFAULT_MARGIN_TOP_MM 10
#define DEFAULT_MARGIN_BOTTOM_MM 10
#define DEFAULT_MARGIN_LEFT_MM 10
#define DEFAULT_MARGIN_RIGHT_MM 10
#define DEFAULT_EXPORT_SCALE 0.7
#ifdef riscos
#define DEFAULT_REFLOW_PERIOD 100 /* time in cs */
#else
#define DEFAULT_REFLOW_PERIOD 25 /* time in cs */
#endif
struct ns_options {
NSOPTION_MAIN_DEFINE;
NSOPTION_EXTRA_DEFINE;
};
/* global option struct */
extern struct ns_options nsoptions;
/* acessors */
#define nsoption_bool(OPTION) (nsoptions.OPTION)
#define nsoption_int(OPTION) (nsoptions.OPTION)
#define nsoption_charp(OPTION) (nsoptions.OPTION)
#define nsoption_colour(OPTION) (nsoptions.OPTION)
#define nsoption_set_bool(OPTION, VALUE) nsoptions.OPTION = VALUE
#define nsoption_set_int(OPTION, VALUE) nsoptions.OPTION = VALUE
#define nsoption_set_colour(OPTION, VALUE) nsoptions.OPTION = VALUE
#define nsoption_set_charp(OPTION, VALUE) do { \
if (nsoptions.OPTION != NULL) { \
free(nsoptions.OPTION); \
} \
nsoptions.OPTION = VALUE; \
if ((nsoptions.OPTION != NULL) && \
(*nsoptions.OPTION == 0)) { \
free(nsoptions.OPTION); \
nsoptions.OPTION = NULL; \
} \
} while (0)
#define nsoption_setnull_charp(OPTION, VALUE) \
do { \
if (nsoptions.OPTION == NULL) { \
nsoptions.OPTION = VALUE; \
if (*nsoptions.OPTION == 0) { \
free(nsoptions.OPTION); \
nsoptions.OPTION = NULL; \
} \
} else { \
free(VALUE); \
} \
} while (0)
/**
* Read options from a file.
*
* \param path name of file to read options from
*
* Option variables corresponding to lines in the file are updated. Missing
* options are unchanged. If the file fails to open, options are unchanged.
*/
void nsoption_read(const char *path);
/**
* Save options to a file.
*
* \param path name of file to write options to
*
* Errors are ignored.
*/
void nsoption_write(const char *path);
/**
* Dump user options to stream
*
* \param outf output stream to dump options to.
*/
void nsoption_dump(FILE *outf);
/**
* Fill a buffer with an option using a format.
*
* The format string is copied into the output buffer with the
* following replaced:
* %k - The options key
* %t - The options type
* %V - value - HTML type formatting
* %v - value - plain formatting
*
* \param string The buffer in which to place the results.
* \param size The size of the string buffer.
* \param option The opaque option number.
* \param fmt The format string.
* \return The number of bytes written to \a string or -1 on error
*/
int nsoption_snoptionf(char *string, size_t size, unsigned int option,
const char *fmt);
/**
* Process commandline and set options approriately.
*/
void nsoption_commandline(int *pargc, char **argv);
/**
* Set default values for unset front-end specific options
*/
void gui_options_init_defaults(void);
/* defines for system colour table */
#define NSOPTION_SYS_COLOUR_START NSOPTION_sys_colour_ActiveBorder
#define NSOPTION_SYS_COLOUR_END NSOPTION_sys_colour_WindowText
#endif
/** An HTTP proxy should be used. */
NSOPTION_BOOL(http_proxy, false)
/** Hostname of proxy. */
NSOPTION_STRING(http_proxy_host, NULL)
/** Proxy port. */
NSOPTION_INTEGER(http_proxy_port, 8080)
/** Proxy authentication method. */
NSOPTION_INTEGER(http_proxy_auth, OPTION_HTTP_PROXY_AUTH_NONE)
/** Proxy authentication user name */
NSOPTION_STRING(http_proxy_auth_user, NULL)
/** Proxy authentication password */
NSOPTION_STRING(http_proxy_auth_pass, NULL)
/** Default font size / 0.1pt. */
NSOPTION_INTEGER(font_size, 128)
/** Minimum font size. */
NSOPTION_INTEGER(font_min_size, 85)
/** Default sans serif font */
NSOPTION_STRING(font_sans, NULL)
/** Default serif font */
NSOPTION_STRING(font_serif, NULL)
/** Default monospace font */
NSOPTION_STRING(font_mono, NULL)
/** Default cursive font */
NSOPTION_STRING(font_cursive, NULL)
/** Default fantasy font */
NSOPTION_STRING(font_fantasy, NULL)
/** Accept-Language header. */
NSOPTION_STRING(accept_language, NULL)
/** Accept-Charset header. */
NSOPTION_STRING(accept_charset, NULL)
/** Preferred maximum size of memory cache / bytes. */
NSOPTION_INTEGER(memory_cache_size, 12 * 1024 * 1024)
/** Preferred expiry size of disc cache / bytes. */
NSOPTION_INTEGER(disc_cache_size, 1024 * 1024 * 1024)
/** Preferred expiry age of disc cache / days. */
NSOPTION_INTEGER(disc_cache_age, 28)
/** Whether to block advertisements */
NSOPTION_BOOL(block_advertisements, false)
/** Disable website tracking, see
* http://www.w3.org/Submission/2011/SUBM-web-tracking-protection-20110224/#dnt-uas */
NSOPTION_BOOL(do_not_track, false)
/** Minimum GIF animation delay */
NSOPTION_INTEGER(minimum_gif_delay, 10)
/** Whether to send the referer HTTP header */
NSOPTION_BOOL(send_referer, true)
/** Whether to fetch foreground images */
NSOPTION_BOOL(foreground_images, true)
/** Whether to fetch background images */
NSOPTION_BOOL(background_images, true)
/** Whether to animate images */
NSOPTION_BOOL(animate_images, true)
/** Whether to execute javascript */
NSOPTION_BOOL(enable_javascript, false)
/** Maximum time (in seconds) to wait for a script to run */
NSOPTION_INTEGER(script_timeout, 10)
/** How many days to retain URL data for */
NSOPTION_INTEGER(expire_url, 28)
/** Default font family */
NSOPTION_INTEGER(font_default, PLOT_FONT_FAMILY_SANS_SERIF)
/** ca-bundle location */
NSOPTION_STRING(ca_bundle, NULL)
/** ca-path location */
NSOPTION_STRING(ca_path, NULL)
/** Cookie file location */
NSOPTION_STRING(cookie_file, NULL)
/** Cookie jar location */
NSOPTION_STRING(cookie_jar, NULL)
/** Home page location */
NSOPTION_STRING(homepage_url, NULL)
/** search web from url bar */
NSOPTION_BOOL(search_url_bar, false)
/** default web search provider */
NSOPTION_INTEGER(search_provider, 0)
/** URL completion in url bar */
NSOPTION_BOOL(url_suggestion, true)
/** default x position of new windows */
NSOPTION_INTEGER(window_x, 0)
/** default y position of new windows */
NSOPTION_INTEGER(window_y, 0)
/** default width of new windows */
NSOPTION_INTEGER(window_width, 0)
/** default height of new windows */
NSOPTION_INTEGER(window_height, 0)
/** width of screen when above options were saved */
NSOPTION_INTEGER(window_screen_width, 0)
/** height of screen when above options were saved */
NSOPTION_INTEGER(window_screen_height, 0)
/** default size of status bar vs. h scroll bar */
NSOPTION_INTEGER(toolbar_status_size, 6667)
/** default window scale */
NSOPTION_INTEGER(scale, 100)
/* Whether to reflow web pages while objects are fetching */
NSOPTION_BOOL(incremental_reflow, true)
/* Minimum time (in cs) between HTML reflows while objects are fetching */
NSOPTION_UINT(min_reflow_period, DEFAULT_REFLOW_PERIOD)
/* use core selection menu */
NSOPTION_BOOL(core_select_menu, false)
/******** Fetcher options ********/
/** Maximum simultaneous active fetchers */
NSOPTION_INTEGER(max_fetchers, 24)
/** Maximum simultaneous active fetchers per host.
* (<=option_max_fetchers else it makes no sense) Note that rfc2616
* section 8.1.4 says that there should be no more than two keepalive
* connections per host. None of the main browsers follow this as it
* slows page fetches down considerably. See
* https://bugzilla.mozilla.org/show_bug.cgi?id=423377#c4
*/
NSOPTION_INTEGER(max_fetchers_per_host, 5)
/** Maximum number of inactive fetchers cached. The total number of
* handles netsurf will therefore have open is this plus
* option_max_fetchers.
*/
NSOPTION_INTEGER(max_cached_fetch_handles, 6)
/** Suppress debug output from cURL. */
NSOPTION_BOOL(suppress_curl_debug, true)
/** Whether to allow target="_blank" */
NSOPTION_BOOL(target_blank, true)
/** Whether second mouse button opens in new tab */
NSOPTION_BOOL(button_2_tab, true)
/******** PDF / Print options ********/
/** top margin of exported page */
NSOPTION_INTEGER(margin_top, DEFAULT_MARGIN_TOP_MM)
/** bottom margin of exported page */
NSOPTION_INTEGER(margin_bottom, DEFAULT_MARGIN_BOTTOM_MM)
/** left margin of exported page */
NSOPTION_INTEGER(margin_left, DEFAULT_MARGIN_LEFT_MM)
/** right margin of exported page */
NSOPTION_INTEGER(margin_right, DEFAULT_MARGIN_RIGHT_MM)
/** scale of exported content */
NSOPTION_INTEGER(export_scale, DEFAULT_EXPORT_SCALE * 100)
/** suppressing images in printed content */
NSOPTION_BOOL(suppress_images, false)
/** turning off all backgrounds for printed content */
NSOPTION_BOOL(remove_backgrounds, false)
/** turning on content loosening for printed content */
NSOPTION_BOOL(enable_loosening, true)
/** compression of PDF documents */
NSOPTION_BOOL(enable_PDF_compression, true)
/** setting a password and encoding PDF documents */
NSOPTION_BOOL(enable_PDF_password, false)
/******** System colours ********/
NSOPTION_COLOUR(sys_colour_ActiveBorder, 0x00000000)
NSOPTION_COLOUR(sys_colour_ActiveCaption, 0x00dddddd)
NSOPTION_COLOUR(sys_colour_AppWorkspace, 0x00eeeeee)
NSOPTION_COLOUR(sys_colour_Background, 0x00aa0000)
NSOPTION_COLOUR(sys_colour_ButtonFace, 0x00aaaaaa)
NSOPTION_COLOUR(sys_colour_ButtonHighlight, 0x00dddddd)
NSOPTION_COLOUR(sys_colour_ButtonShadow, 0x00bbbbbb)
NSOPTION_COLOUR(sys_colour_ButtonText, 0x00000000)
NSOPTION_COLOUR(sys_colour_CaptionText, 0x00000000)
NSOPTION_COLOUR(sys_colour_GrayText, 0x00cccccc)
NSOPTION_COLOUR(sys_colour_Highlight, 0x00ee0000)
NSOPTION_COLOUR(sys_colour_HighlightText, 0x00000000)
NSOPTION_COLOUR(sys_colour_InactiveBorder, 0x00ffffff)
NSOPTION_COLOUR(sys_colour_InactiveCaption, 0x00ffffff)
NSOPTION_COLOUR(sys_colour_InactiveCaptionText, 0x00cccccc)
NSOPTION_COLOUR(sys_colour_InfoBackground, 0x00aaaaaa)
NSOPTION_COLOUR(sys_colour_InfoText, 0x00000000)
NSOPTION_COLOUR(sys_colour_Menu, 0x00aaaaaa)
NSOPTION_COLOUR(sys_colour_MenuText, 0x00000000)
NSOPTION_COLOUR(sys_colour_Scrollbar, 0x00aaaaaa)
NSOPTION_COLOUR(sys_colour_ThreeDDarkShadow, 0x00555555)
NSOPTION_COLOUR(sys_colour_ThreeDFace, 0x00dddddd)
NSOPTION_COLOUR(sys_colour_ThreeDHighlight, 0x00aaaaaa)
NSOPTION_COLOUR(sys_colour_ThreeDLightShadow, 0x00999999)
NSOPTION_COLOUR(sys_colour_ThreeDShadow, 0x00777777)
NSOPTION_COLOUR(sys_colour_Window, 0x00aaaaaa)
NSOPTION_COLOUR(sys_colour_WindowFrame, 0x00000000)
NSOPTION_COLOUR(sys_colour_WindowText, 0x00000000)

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008, 2010 Daniel Silverstone <dsilvers@netsurf-browser.org>
* Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@ -16,93 +16,53 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _NETSURF_DESKTOP_OPTIONS_INCLUDING_
#error "Frontend options header cannot be included directly"
#endif
#ifndef _NETSURF_FRAMEBUFFER_OPTIONS_H_
#define _NETSURF_FRAMEBUFFER_OPTIONS_H_
#define NSOPTION_EXTRA_DEFINE \
/* surface options */ \
int fb_depth; \
int fb_refresh; \
char *fb_device; \
char *fb_input_devpath; \
char *fb_input_glob; \
\
/* toolkit options */ \
int fb_furniture_size; /**< toolkit furniture size */ \
int fb_toolbar_size; /**< toolbar furniture size */ \
char *fb_toolbar_layout; /**< toolbar layout */ \
bool fb_osk; /**< enable on screen keyboard */ \
\
/* font options */ \
bool fb_font_monochrome; /**< render font monochrome */ \
int fb_font_cachesize; /**< size of font glyph cache in kilobytes. */ \
\
char *fb_face_sans_serif; /**< default sans face */ \
char *fb_face_sans_serif_bold; /**< bold sans face */ \
char *fb_face_sans_serif_italic; /**< bold sans face */ \
char *fb_face_sans_serif_italic_bold; /**< bold sans face */ \
\
char *fb_face_serif; /**< serif face */ \
char *fb_face_serif_bold; /**< bold serif face */ \
\
char *fb_face_monospace; /**< monospace face */ \
char *fb_face_monospace_bold; /**< bold monospace face */ \
\
char *fb_face_cursive; /**< cursive face */ \
char *fb_face_fantasy /**< fantasy face */
#define NSOPTION_EXTRA_DEFAULTS \
.fb_depth = 32, \
.fb_refresh = 70, \
.fb_device = NULL, \
.fb_input_devpath = NULL, \
.fb_input_glob = NULL, \
.fb_furniture_size = 18, \
.fb_toolbar_size = 30, \
.fb_toolbar_layout = NULL, \
.fb_osk = false, \
.fb_font_monochrome = false, \
.fb_font_cachesize = 2048, \
.fb_face_sans_serif = NULL, \
.fb_face_sans_serif_bold = NULL, \
.fb_face_sans_serif_italic = NULL, \
.fb_face_sans_serif_italic_bold = NULL, \
.fb_face_serif = NULL, \
.fb_face_serif_bold = NULL, \
.fb_face_monospace = NULL, \
.fb_face_monospace_bold = NULL, \
.fb_face_cursive = NULL, \
.fb_face_fantasy = NULL
#define NSOPTION_EXTRA_TABLE \
{ "fb_depth", OPTION_INTEGER, &nsoptions.fb_depth }, \
{ "fb_refresh", OPTION_INTEGER, &nsoptions.fb_refresh }, \
{ "fb_device", OPTION_STRING, &nsoptions.fb_device }, \
{ "fb_input_devpath", OPTION_STRING, &nsoptions.fb_input_devpath }, \
{ "fb_input_glob", OPTION_STRING, &nsoptions.fb_input_glob }, \
{ "fb_furniture_size", OPTION_INTEGER, &nsoptions.fb_furniture_size }, \
{ "fb_toolbar_size", OPTION_INTEGER, &nsoptions.fb_toolbar_size }, \
{ "fb_toolbar_layout", OPTION_STRING, &nsoptions.fb_toolbar_layout }, \
{ "fb_osk", OPTION_BOOL, &nsoptions.fb_osk }, \
{ "fb_font_monochrome", OPTION_BOOL, &nsoptions.fb_font_monochrome }, \
{ "fb_font_cachesize", OPTION_INTEGER, &nsoptions.fb_font_cachesize }, \
{ "fb_face_sans_serif", OPTION_STRING, &nsoptions.fb_face_sans_serif }, \
{ "fb_face_sans_serif_bold", OPTION_STRING, &nsoptions.fb_face_sans_serif_bold }, \
{ "fb_face_sans_serif_italic", OPTION_STRING, &nsoptions.fb_face_sans_serif_italic }, \
{ "fb_face_sans_serif_italic_bold", OPTION_STRING, &nsoptions.fb_face_sans_serif_italic_bold }, \
{ "fb_face_serif", OPTION_STRING, &nsoptions.fb_face_serif }, \
{ "fb_serif_bold", OPTION_STRING, &nsoptions.fb_face_serif_bold }, \
{ "fb_face_monospace", OPTION_STRING, &nsoptions.fb_face_monospace }, \
{ "fb_face_monospace_bold", OPTION_STRING, &nsoptions.fb_face_monospace_bold }, \
{ "fb_face_cursive", OPTION_STRING, &nsoptions.fb_face_cursive }, \
{ "fb_face_fantasy", OPTION_STRING, &nsoptions.fb_face_fantasy }
/* currently nothing here */
#endif
/***** surface options *****/
NSOPTION_INTEGER(fb_depth, 32)
NSOPTION_INTEGER(fb_refresh, 70)
NSOPTION_STRING(fb_device, NULL)
NSOPTION_STRING(fb_input_devpath, NULL)
NSOPTION_STRING(fb_input_glob, NULL)
/***** toolkit options *****/
/** toolkit furniture size */
NSOPTION_INTEGER(fb_furniture_size, 18)
/** toolbar furniture size */
NSOPTION_INTEGER(fb_toolbar_size, 30)
/** toolbar layout */
NSOPTION_STRING(fb_toolbar_layout, NULL)
/** enable on screen keyboard */
NSOPTION_BOOL(fb_osk, false)
/***** font options *****/
/** render all fonts monochrome */
NSOPTION_BOOL(fb_font_monochrome, false)
/** size of font glyph cache in kilobytes. */
NSOPTION_INTEGER(fb_font_cachesize, 2048)
/* Font face paths. These are treated as absolute paths if they start
* with a / otherwise the compile time resource path is searched.
*/
NSOPTION_STRING(fb_face_sans_serif, NULL)
NSOPTION_STRING(fb_face_sans_serif_bold, NULL)
NSOPTION_STRING(fb_face_sans_serif_italic, NULL)
NSOPTION_STRING(fb_face_sans_serif_italic_bold, NULL)
NSOPTION_STRING(fb_face_serif, NULL)
NSOPTION_STRING(fb_serif_bold, NULL)
NSOPTION_STRING(fb_face_monospace, NULL)
NSOPTION_STRING(fb_face_monospace_bold, NULL)
NSOPTION_STRING(fb_face_cursive, NULL)
NSOPTION_STRING(fb_face_fantasy, NULL)
/*
* Local Variables:
* c-basic-offset:8

View File

@ -1,5 +1,5 @@
/*
* Copyright 2006 Rob Kendrick <rjek@rjek.com>
* Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@ -16,68 +16,60 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _NETSURF_DESKTOP_OPTIONS_INCLUDING_
#error "Frontend options header cannot be included directly"
#endif
#ifndef _NETSURF_GTK_OPTIONS_H_
#define _NETSURF_GTK_OPTIONS_H_
#define NSOPTION_EXTRA_DEFINE \
bool render_resample; \
bool downloads_clear; \
bool request_overwrite; \
char *downloads_directory; \
char *url_file; \
bool show_single_tab; \
int button_type; \
bool disable_popups; \
bool disable_plugins; \
int history_age; \
bool hover_urls; \
bool focus_new; \
bool new_blank; \
char *hotlist_path; \
bool source_tab; \
int current_theme; \
int position_tab
#define NSOPTION_EXTRA_DEFAULTS \
.render_resample = true, \
.downloads_clear = false, \
.request_overwrite = true, \
.downloads_directory = NULL, \
.url_file = NULL, \
.show_single_tab = false, \
.button_type = 0, \
.disable_popups = false, \
.disable_plugins = false, \
.history_age = 0, \
.hover_urls = false, \
.focus_new = false, \
.new_blank = false, \
.hotlist_path = NULL, \
.source_tab = false, \
.current_theme = 0, \
.position_tab = 0
#define NSOPTION_EXTRA_TABLE \
{ "render_resample", OPTION_BOOL, &nsoptions.render_resample }, \
{ "downloads_clear", OPTION_BOOL, &nsoptions.downloads_clear }, \
{ "request_overwrite", OPTION_BOOL, &nsoptions.request_overwrite }, \
{ "downloads_directory",OPTION_STRING, &nsoptions.downloads_directory }, \
{ "url_file", OPTION_STRING, &nsoptions.url_file }, \
{ "show_single_tab", OPTION_BOOL, &nsoptions.show_single_tab }, \
{ "button_type", OPTION_INTEGER, &nsoptions.button_type}, \
{ "disable_popups", OPTION_BOOL, &nsoptions.disable_popups}, \
{ "disable_plugins", OPTION_BOOL, &nsoptions.disable_plugins}, \
{ "history_age", OPTION_INTEGER, &nsoptions.history_age}, \
{ "hover_urls", OPTION_BOOL, &nsoptions.hover_urls}, \
{ "focus_new", OPTION_BOOL, &nsoptions.focus_new}, \
{ "new_blank", OPTION_BOOL, &nsoptions.new_blank}, \
{ "hotlist_path", OPTION_STRING, &nsoptions.hotlist_path}, \
{ "source_tab", OPTION_BOOL, &nsoptions.source_tab},\
{ "current_theme", OPTION_INTEGER, &nsoptions.current_theme}, \
{ "position_tab", OPTION_INTEGER, &nsoptions.position_tab}
/* currently nothing here */
#endif
/* High quality image scaling */
NSOPTION_BOOL(render_resample, true)
/* clear downloads */
NSOPTION_BOOL(downloads_clear, false)
/* prompt before overwriting downloads */
NSOPTION_BOOL(request_overwrite, true)
/* location to download files to */
NSOPTION_STRING(downloads_directory, NULL)
/* where to store URL database */
NSOPTION_STRING(url_file, NULL)
/* Always show tabs even if there is only one */
NSOPTION_BOOL(show_single_tab, false)
/* size of buttons */
NSOPTION_INTEGER(button_type, 0)
/* disallow popup windows */
NSOPTION_BOOL(disable_popups, false)
/* disable content plugins */
NSOPTION_BOOL(disable_plugins, false)
/* number of days to keep history data */
NSOPTION_INTEGER(history_age, 0)
/* show urls in local history browser */
NSOPTION_BOOL(hover_urls, false)
/* bring new tabs to front */
NSOPTION_BOOL(focus_new, false)
/* new tabs are blank instead of homepage */
NSOPTION_BOOL(new_blank, false)
/* path to save hotlist file */
NSOPTION_STRING(hotlist_path, NULL)
/* open source views in a tab */
NSOPTION_BOOL(source_tab, false)
/* currently selected theme */
NSOPTION_INTEGER(current_theme, 0)
/* where tabs are positioned */
NSOPTION_INTEGER(position_tab, 0)

View File

@ -1,5 +1,5 @@
/*
* Copyright 2006 Rob Kendrick <rjek@rjek.com>
* Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@ -16,66 +16,28 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _NETSURF_DESKTOP_OPTIONS_INCLUDING_
#error "Frontend options header cannot be included directly"
#endif
#ifndef _NETSURF_MONKEY_OPTIONS_H_
#define _NETSURF_MONKEY_OPTIONS_H_
#define NSOPTION_EXTRA_DEFINE \
bool render_resample; \
bool downloads_clear; \
bool request_overwrite; \
char *downloads_directory; \
char *url_file; \
bool show_single_tab; \
int button_type; \
bool disable_popups; \
bool disable_plugins; \
int history_age; \
bool hover_urls; \
bool focus_new; \
bool new_blank; \
char *hotlist_path; \
bool source_tab; \
int current_theme
#define NSOPTION_EXTRA_DEFAULTS \
.render_resample = true, \
.downloads_clear = false, \
.request_overwrite = true, \
.downloads_directory = NULL, \
.url_file = NULL, \
.show_single_tab = false, \
.button_type = 0, \
.disable_popups = false, \
.disable_plugins = false, \
.history_age = 0, \
.hover_urls = false, \
.focus_new = false, \
.new_blank = false, \
.hotlist_path = NULL, \
.source_tab = false, \
.current_theme = 0
#define NSOPTION_EXTRA_TABLE \
{ "render_resample", OPTION_BOOL, &nsoptions.render_resample }, \
{ "downloads_clear", OPTION_BOOL, &nsoptions.downloads_clear }, \
{ "request_overwrite", OPTION_BOOL, &nsoptions.request_overwrite }, \
{ "downloads_directory",OPTION_STRING, &nsoptions.downloads_directory }, \
{ "url_file", OPTION_STRING, &nsoptions.url_file }, \
{ "show_single_tab", OPTION_BOOL, &nsoptions.show_single_tab }, \
{ "button_type", OPTION_INTEGER, &nsoptions.button_type}, \
{ "disable_popups", OPTION_BOOL, &nsoptions.disable_popups}, \
{ "disable_plugins", OPTION_BOOL, &nsoptions.disable_plugins}, \
{ "history_age", OPTION_INTEGER, &nsoptions.history_age}, \
{ "hover_urls", OPTION_BOOL, &nsoptions.hover_urls}, \
{ "focus_new", OPTION_BOOL, &nsoptions.focus_new}, \
{ "new_blank", OPTION_BOOL, &nsoptions.new_blank}, \
{ "hotlist_path", OPTION_STRING, &nsoptions.hotlist_path}, \
{ "source_tab", OPTION_BOOL, &nsoptions.source_tab},\
{ "current_theme", OPTION_INTEGER, &nsoptions.current_theme}
/* currently nothing here */
#endif
NSOPTION_BOOL(render_resample, true)
NSOPTION_BOOL(downloads_clear, false)
NSOPTION_BOOL(request_overwrite, true)
NSOPTION_STRING(downloads_directory, NULL)
NSOPTION_STRING(url_file, NULL)
NSOPTION_BOOL(show_single_tab, false)
NSOPTION_INTEGER(button_type, 0)
NSOPTION_BOOL(disable_popups, false)
NSOPTION_BOOL(disable_plugins, false)
NSOPTION_INTEGER(history_age, 0)
NSOPTION_BOOL(hover_urls, false)
NSOPTION_BOOL(focus_new, false)
NSOPTION_BOOL(new_blank, false)
NSOPTION_STRING(hotlist_path, NULL)
NSOPTION_BOOL(source_tab, false)
NSOPTION_INTEGER(current_theme, 0)

View File

@ -1,7 +1,5 @@
/*
* Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
* Copyright 2004 James Bursa <bursa@users.sourceforge.net>
* Copyright 2004 Richard Wilson <not_ginger_matt@users.sourceforge.net>
* Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@ -22,131 +20,52 @@
* RISC OS specific options.
*/
#include "riscos/tinct.h"
#ifndef _NETSURF_DESKTOP_OPTIONS_INCLUDING_
#error "Frontend options header cannot be included directly"
#endif
#ifndef _NETSURF_RISCOS_OPTIONS_H_
#define _NETSURF_RISCOS_OPTIONS_H_
#define NSOPTION_EXTRA_DEFINE \
bool use_mouse_gestures; \
bool allow_text_selection; \
char *theme; \
char *language; \
int fg_plot_style; /* tinct flagword */ \
int bg_plot_style; /* tinct flagword */ \
bool history_tooltip; \
bool toolbar_show_buttons; \
bool toolbar_show_address; \
bool toolbar_show_throbber; \
char *toolbar_browser; \
char *toolbar_hotlist; \
char *toolbar_history; \
char *toolbar_cookies; \
bool window_stagger; \
bool window_size_clone; \
bool buffer_animations; \
bool buffer_everything; \
bool open_browser_at_startup; \
bool no_plugins; \
bool block_popups; \
int image_memory_direct; /* -1 means auto-detect */ \
int image_memory_compressed; /* -1 means auto-detect */ \
bool strip_extensions; \
bool confirm_overwrite; \
char *url_path; \
char *url_save; \
char *hotlist_path; \
char *hotlist_save; \
char *recent_path; \
char *recent_save; \
char *theme_path; \
char *theme_save; \
bool thumbnail_iconise; \
bool interactive_help; \
bool external_hotlists; \
char *external_hotlist_app
#include "riscos/tinct.h"
/* setup longer default reflow time */
#define DEFAULT_REFLOW_PERIOD 100 /* time in cs */
#define NSOPTION_EXTRA_DEFAULTS \
.use_mouse_gestures = false, \
.allow_text_selection = true, \
.theme = NULL, \
.language = NULL, \
.fg_plot_style = tinct_ERROR_DIFFUSE, \
.bg_plot_style = tinct_DITHER, \
.history_tooltip = true, \
.toolbar_show_buttons = true, \
.toolbar_show_address = true, \
.toolbar_show_throbber = true, \
.toolbar_browser = NULL, \
.toolbar_hotlist = NULL, \
.toolbar_history = NULL, \
.toolbar_cookies = NULL, \
.window_stagger = true, \
.window_size_clone = true, \
.buffer_animations = true, \
.buffer_everything = true, \
.open_browser_at_startup = false, \
.no_plugins = false, \
.block_popups = false, \
.image_memory_direct = -1, \
.image_memory_compressed = -1, \
.strip_extensions = true, \
.confirm_overwrite = true, \
.url_path = NULL, \
.url_save = NULL, \
.hotlist_path = NULL, \
.hotlist_save = NULL, \
.recent_path = NULL, \
.recent_save = NULL, \
.theme_path = NULL, \
.theme_save = NULL, \
.thumbnail_iconise = true, \
.interactive_help = true, \
.external_hotlists = false, \
.external_hotlist_app = NULL
#define NSOPTION_EXTRA_TABLE \
{ "use_mouse_gestures", OPTION_BOOL, &nsoptions.use_mouse_gestures },\
{ "allow_text_selection", OPTION_BOOL, &nsoptions.allow_text_selection },\
{ "theme", OPTION_STRING, &nsoptions.theme },\
{ "language", OPTION_STRING, &nsoptions.language },\
{ "plot_fg_quality", OPTION_INTEGER, &nsoptions.fg_plot_style },\
{ "plot_bg_quality", OPTION_INTEGER, &nsoptions.bg_plot_style },\
{ "history_tooltip", OPTION_BOOL, &nsoptions.history_tooltip }, \
{ "toolbar_show_buttons", OPTION_BOOL, &nsoptions.toolbar_show_buttons }, \
{ "toolbar_show_address", OPTION_BOOL, &nsoptions.toolbar_show_address }, \
{ "toolbar_show_throbber", OPTION_BOOL, &nsoptions.toolbar_show_throbber }, \
{ "toolbar_browser", OPTION_STRING, &nsoptions.toolbar_browser }, \
{ "toolbar_hotlist", OPTION_STRING, &nsoptions.toolbar_hotlist }, \
{ "toolbar_history", OPTION_STRING, &nsoptions.toolbar_history }, \
{ "toolbar_cookies", OPTION_STRING, &nsoptions.toolbar_cookies }, \
{ "window_stagger", OPTION_BOOL, &nsoptions.window_stagger }, \
{ "window_size_clone", OPTION_BOOL, &nsoptions.window_size_clone }, \
{ "buffer_animations", OPTION_BOOL, &nsoptions.buffer_animations }, \
{ "buffer_everything", OPTION_BOOL, &nsoptions.buffer_everything }, \
{ "open_browser_at_startup",OPTION_BOOL, &nsoptions.open_browser_at_startup }, \
{ "no_plugins", OPTION_BOOL, &nsoptions.no_plugins }, \
{ "block_popups", OPTION_BOOL, &nsoptions.block_popups }, \
{ "image_memory_direct", OPTION_INTEGER, &nsoptions.image_memory_direct }, \
{ "image_memory_compressed",OPTION_INTEGER, &nsoptions.image_memory_compressed }, \
{ "strip_extensions", OPTION_BOOL, &nsoptions.strip_extensions }, \
{ "confirm_overwrite", OPTION_BOOL, &nsoptions.confirm_overwrite }, \
{ "url_path", OPTION_STRING, &nsoptions.url_path }, \
{ "url_save", OPTION_STRING, &nsoptions.url_save }, \
{ "hotlist_path", OPTION_STRING, &nsoptions.hotlist_path }, \
{ "hotlist_save", OPTION_STRING, &nsoptions.hotlist_save }, \
{ "recent_path", OPTION_STRING, &nsoptions.recent_path }, \
{ "recent_save", OPTION_STRING, &nsoptions.recent_save }, \
{ "theme_path", OPTION_STRING, &nsoptions.theme_path }, \
{ "theme_save", OPTION_STRING, &nsoptions.theme_save }, \
{ "thumbnail_iconise", OPTION_BOOL, &nsoptions.thumbnail_iconise }, \
{ "interactive_help", OPTION_BOOL, &nsoptions.interactive_help }, \
{ "external_hotlists", OPTION_BOOL, &nsoptions.external_hotlists }, \
{ "external_hotlist_app", OPTION_STRING, &nsoptions.external_hotlist_app }
#define CHOICES_PREFIX "<Choices$Write>.WWW.NetSurf."
#endif
NSOPTION_BOOL(use_mouse_gestures, false)
NSOPTION_BOOL(allow_text_selection, false)
NSOPTION_STRING(theme, "Aletheia")
NSOPTION_STRING(language, NULL)
NSOPTION_INTEGER(plot_fg_quality, tinct_ERROR_DIFFUSE)
NSOPTION_INTEGER(plot_bg_quality, tinct_DITHER)
NSOPTION_BOOL(history_tooltip, true)
NSOPTION_BOOL(toolbar_show_buttons, true)
NSOPTION_BOOL(toolbar_show_address, true)
NSOPTION_BOOL(toolbar_show_throbber, true)
NSOPTION_STRING(toolbar_browser, "0123|58|9")
NSOPTION_STRING(toolbar_hotlist, "40|12|3")
NSOPTION_STRING(toolbar_history, "0|12|3")
NSOPTION_STRING(toolbar_cookies, "0|12")
NSOPTION_BOOL(window_stagger, true)
NSOPTION_BOOL(window_size_clone, true)
NSOPTION_BOOL(buffer_animations, true)
NSOPTION_BOOL(buffer_everything, true)
NSOPTION_BOOL(open_browser_at_startup, false)
NSOPTION_BOOL(no_plugins, false)
NSOPTION_BOOL(block_popups, false)
NSOPTION_INTEGER(image_memory_direct, -1)
NSOPTION_INTEGER(image_memory_compressed, -1)
NSOPTION_BOOL(strip_extensions, true)
NSOPTION_BOOL(confirm_overwrite, true)
NSOPTION_STRING(url_path, "NetSurf:URL")
NSOPTION_STRING(url_save, CHOICES_PREFIX "URL")
NSOPTION_STRING(hotlist_path, "NetSurf:Hotlist")
NSOPTION_STRING(hotlist_save, CHOICES_PREFIX "Hotlist")
NSOPTION_STRING(recent_path, "NetSurf:Recent")
NSOPTION_STRING(recent_save, CHOICES_PREFIX "Recent")
NSOPTION_STRING(theme_path, "NetSurf:Themes")
NSOPTION_STRING(theme_save, CHOICES_PREFIX "Themes")
NSOPTION_BOOL(thumbnail_iconise, true)
NSOPTION_BOOL(interactive_help, true)
NSOPTION_BOOL(external_hotlists, false)
NSOPTION_STRING(external_hotlist_app, NULL)