NetSurf
options.h
Go to the documentation of this file.
1/*
2 * Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/**
20 * \file
21 * Option available on all platforms
22 *
23 * Non-platform specific options can be added by editing this file
24 *
25 * Platform specific options should be added in the platform options.h.
26 *
27 * This header is specificaly intented to be included multiple times
28 * with different macro definitions so there is no guard
29 */
30
31#ifndef NETSURF_DESKTOP_OPTIONS_H_
32#define NETSURF_DESKTOP_OPTIONS_H_
33
34#include "netsurf/types.h"
35
36/* defines for system colour table */
37#define NSOPTION_SYS_COLOUR_START NSOPTION_sys_colour_ActiveBorder
38#define NSOPTION_SYS_COLOUR_END NSOPTION_sys_colour_WindowText
39
40#endif
41
42/** An HTTP proxy should be used. */
43NSOPTION_BOOL(http_proxy, false)
44
45/** Hostname of proxy. */
46NSOPTION_STRING(http_proxy_host, NULL)
47
48/** Proxy port. */
49NSOPTION_INTEGER(http_proxy_port, 8080)
50
51/** Proxy authentication method. */
53
54/** Proxy authentication user name */
55NSOPTION_STRING(http_proxy_auth_user, NULL)
56
57/** Proxy authentication password */
58NSOPTION_STRING(http_proxy_auth_pass, NULL)
59
60/** Proxy omission list */
61NSOPTION_STRING(http_proxy_noproxy, "localhost")
62
63/** Default treeview font size (unit: 0.1pt) */
64NSOPTION_INTEGER(treeview_font_size, 110)
65
66/** Default font size (unit: 0.1pt) */
67NSOPTION_INTEGER(font_size, 128)
68
69/** Minimum font size. */
70NSOPTION_INTEGER(font_min_size, 85)
71
72/** Default sans serif font */
73NSOPTION_STRING(font_sans, NULL)
74/** Default serif font */
75NSOPTION_STRING(font_serif, NULL)
76
77/** Default monospace font */
78NSOPTION_STRING(font_mono, NULL)
79
80/** Default cursive font */
81NSOPTION_STRING(font_cursive, NULL)
82
83/** Default fantasy font */
84NSOPTION_STRING(font_fantasy, NULL)
85
86/** Accept-Language header. */
87NSOPTION_STRING(accept_language, NULL)
88
89/** Accept-Charset header. */
90NSOPTION_STRING(accept_charset, NULL)
91
92/** Preferred maximum size of memory cache / bytes. */
93NSOPTION_INTEGER(memory_cache_size, 12 * 1024 * 1024)
94
95/** Preferred location of disc cache, or NULL for system provided location */
96NSOPTION_STRING(disc_cache_path, NULL)
97
98/** Preferred expiry size of disc cache / bytes. */
99NSOPTION_UINT(disc_cache_size, 1024 * 1024 * 1024)
100
101/** Preferred expiry age of disc cache / days. */
102NSOPTION_INTEGER(disc_cache_age, 28)
103
104/** Whether to block advertisements */
105NSOPTION_BOOL(block_advertisements, false)
106
107/** Disable website tracking, see
108 * http://www.w3.org/Submission/2011/SUBM-web-tracking-protection-20110224/#dnt-uas */
109NSOPTION_BOOL(do_not_track, false)
110
111/** Whether to send the referer HTTP header */
112NSOPTION_BOOL(send_referer, true)
113
114/** Whether to fetch foreground images */
115NSOPTION_BOOL(foreground_images, true)
116
117/** Whether to fetch background images */
118NSOPTION_BOOL(background_images, true)
119
120/** Whether to animate images */
121NSOPTION_BOOL(animate_images, true)
122
123/** Whether to execute javascript */
124NSOPTION_BOOL(enable_javascript, false)
125
126/** Whether to allow Author level CSS. */
127NSOPTION_BOOL(author_level_css, true)
128
129/** Maximum time (in seconds) to wait for a script to run */
130NSOPTION_INTEGER(script_timeout, 10)
131
132/** How many days to retain URL data for */
133NSOPTION_INTEGER(expire_url, 28)
134
135/** Default font family */
137
138/** ca-bundle location */
139NSOPTION_STRING(ca_bundle, NULL)
140
141/** ca-path location */
142NSOPTION_STRING(ca_path, NULL)
143
144/** Cookie file location */
145NSOPTION_STRING(cookie_file, NULL)
146
147/** Cookie jar location */
148NSOPTION_STRING(cookie_jar, NULL)
149
150/** Home page location */
151NSOPTION_STRING(homepage_url, NULL)
152
153/** search web from url bar */
154NSOPTION_BOOL(search_url_bar, false)
155
156/** default web search provider */
157NSOPTION_STRING(search_web_provider, NULL)
158
159/** URL completion in url bar */
160NSOPTION_BOOL(url_suggestion, true)
161
162/** default x position of new windows */
163NSOPTION_INTEGER(window_x, 0)
164
165/** default y position of new windows */
166NSOPTION_INTEGER(window_y, 0)
167
168/** default width of new windows */
169NSOPTION_INTEGER(window_width, 0)
170
171/** default height of new windows */
172NSOPTION_INTEGER(window_height, 0)
173
174/** default size of status bar vs. h scroll bar */
175NSOPTION_INTEGER(toolbar_status_size, 6667)
176
177/** default window scale */
178NSOPTION_INTEGER(scale, 100)
179
180/* Whether to reflow web pages while objects are fetching */
181NSOPTION_BOOL(incremental_reflow, true)
182
183/* Minimum time (in cs) between HTML reflows while objects are fetching */
184NSOPTION_UINT(min_reflow_period, DEFAULT_REFLOW_PERIOD)
185
186/* use core selection menu */
187NSOPTION_BOOL(core_select_menu, false)
188
189/* display decoded international domain names */
190NSOPTION_BOOL(display_decoded_idn, false)
191
192/******** Fetcher options ********/
193
194/** Maximum simultaneous active fetchers */
195NSOPTION_INTEGER(max_fetchers, 24)
196
197/** Maximum simultaneous active fetchers per host.
198 * (<=option_max_fetchers else it makes no sense) Note that rfc2616
199 * section 8.1.4 says that there should be no more than two keepalive
200 * connections per host. None of the main browsers follow this as it
201 * slows page fetches down considerably. See
202 * https://bugzilla.mozilla.org/show_bug.cgi?id=423377#c4
203 */
204NSOPTION_INTEGER(max_fetchers_per_host, 5)
205
206/** Maximum number of inactive fetchers cached. The total number of
207 * handles netsurf will therefore have open is this plus
208 * option_max_fetchers.
209 */
210NSOPTION_INTEGER(max_cached_fetch_handles, 6)
211
212/** Number of times to retry timed-out fetches before giving up. */
213NSOPTION_UINT(max_retried_fetches, 1)
214
215/** Number of seconds to allow for a DNS-resolution+connect() before timing out
216 * the cURL socket.
217 */
218NSOPTION_UINT(curl_fetch_timeout, 30)
219
220/** Suppress debug output from cURL. */
221NSOPTION_BOOL(suppress_curl_debug, true)
222
223/******** appearnce of new browser views ********/
224
225/** Whether to allow target="_blank" */
226NSOPTION_BOOL(target_blank, true)
227
228/** auxillary (second) mouse button opens in new tab */
229NSOPTION_BOOL(button_2_tab, true)
230
231/** control if new view (window or tab) opens in foreground */
232NSOPTION_BOOL(foreground_new, false)
233
234/******** PDF / Print options ********/
235
236/** top margin of exported page */
238
239/** bottom margin of exported page */
241
242/** left margin of exported page */
244
245/** right margin of exported page */
247
248/** scale of exported content */
249NSOPTION_INTEGER(export_scale, DEFAULT_EXPORT_SCALE * 100)
250
251/** suppressing images in printed content */
252NSOPTION_BOOL(suppress_images, false)
253
254/** turning off all backgrounds for printed content */
255NSOPTION_BOOL(remove_backgrounds, false)
256
257/** turning on content loosening for printed content */
258NSOPTION_BOOL(enable_loosening, true)
259
260/** compression of PDF documents */
261NSOPTION_BOOL(enable_PDF_compression, true)
262
263/** setting a password and encoding PDF documents */
264NSOPTION_BOOL(enable_PDF_password, false)
265
266/** whether to prefer dark mode (light on dark) */
267NSOPTION_BOOL(prefer_dark_mode, false)
268
269/******** System colours ********/
270NSOPTION_COLOUR(sys_colour_ActiveBorder, 0x00d3d3d3)
271NSOPTION_COLOUR(sys_colour_ActiveCaption, 0x00f1f1f1)
272NSOPTION_COLOUR(sys_colour_AppWorkspace, 0x00f1f1f1)
273NSOPTION_COLOUR(sys_colour_Background, 0x006e6e6e)
274NSOPTION_COLOUR(sys_colour_ButtonFace, 0x00f9f9f9)
275NSOPTION_COLOUR(sys_colour_ButtonHighlight, 0x00ffffff)
276NSOPTION_COLOUR(sys_colour_ButtonShadow, 0x00aeaeae)
277NSOPTION_COLOUR(sys_colour_ButtonText, 0x004c4c4c)
278NSOPTION_COLOUR(sys_colour_CaptionText, 0x004c4c4c)
279NSOPTION_COLOUR(sys_colour_GrayText, 0x00505050)
280NSOPTION_COLOUR(sys_colour_Highlight, 0x00c00800)
281NSOPTION_COLOUR(sys_colour_HighlightText, 0x00ffffff)
282NSOPTION_COLOUR(sys_colour_InactiveBorder, 0x00f1f1f1)
283NSOPTION_COLOUR(sys_colour_InactiveCaption, 0x00e6e6e6)
284NSOPTION_COLOUR(sys_colour_InactiveCaptionText, 0x00a6a6a6)
285NSOPTION_COLOUR(sys_colour_InfoBackground, 0x008fdfef)
286NSOPTION_COLOUR(sys_colour_InfoText, 0x00000000)
287NSOPTION_COLOUR(sys_colour_Menu, 0x00f1f1f1)
288NSOPTION_COLOUR(sys_colour_MenuText, 0x004e4e4e)
289NSOPTION_COLOUR(sys_colour_Scrollbar, 0x00cccccc)
290NSOPTION_COLOUR(sys_colour_ThreeDDarkShadow, 0x00aeaeae)
291NSOPTION_COLOUR(sys_colour_ThreeDFace, 0x00f9f9f9)
292NSOPTION_COLOUR(sys_colour_ThreeDHighlight, 0x00ffffff)
293NSOPTION_COLOUR(sys_colour_ThreeDLightShadow, 0x00ffffff)
294NSOPTION_COLOUR(sys_colour_ThreeDShadow, 0x00d5d5d5)
295NSOPTION_COLOUR(sys_colour_Window, 0x00f1f1f1)
296NSOPTION_COLOUR(sys_colour_WindowFrame, 0x004e4e4e)
297NSOPTION_COLOUR(sys_colour_WindowText, 0x00000000)
298
299/** Filter for non-verbose logging */
300NSOPTION_STRING(log_filter, NETSURF_BUILTIN_LOG_FILTER)
301/** Filter for verbose logging */
302NSOPTION_STRING(verbose_filter, NETSURF_BUILTIN_VERBOSE_FILTER)
#define DEFAULT_REFLOW_PERIOD
Definition: options.h:23
@ PLOT_FONT_FAMILY_SANS_SERIF
Definition: plot_style.h:89
NetSurf types.
#define NSOPTION_INTEGER(NAME, DEFAULT)
Definition: nsoption.c:54
#define NSOPTION_BOOL(NAME, DEFAULT)
Definition: nsoption.c:48
#define NSOPTION_STRING(NAME, DEFAULT)
Definition: nsoption.c:51
#define NSOPTION_UINT(NAME, DEFAULT)
Definition: nsoption.c:57
#define NSOPTION_COLOUR(NAME, DEFAULT)
Definition: nsoption.c:60
#define DEFAULT_MARGIN_BOTTOM_MM
Definition: nsoption.h:91
#define DEFAULT_EXPORT_SCALE
Definition: nsoption.h:94
#define DEFAULT_MARGIN_RIGHT_MM
Definition: nsoption.h:93
#define DEFAULT_MARGIN_TOP_MM
Definition: nsoption.h:90
#define DEFAULT_MARGIN_LEFT_MM
Definition: nsoption.h:92
@ OPTION_HTTP_PROXY_AUTH_NONE
Definition: nsoption.h:86