43#ifndef _NETSURF_UTILS_NSOPTION_H_
44#define _NETSURF_UTILS_NSOPTION_H_
53#define NSOPTION_BOOL(NAME, DEFAULT)
54#define NSOPTION_STRING(NAME, DEFAULT)
55#define NSOPTION_INTEGER(NAME, DEFAULT)
56#define NSOPTION_UINT(NAME, DEFAULT)
57#define NSOPTION_COLOUR(NAME, DEFAULT)
68#elif defined(nsframebuffer)
72#elif defined(nsmonkey)
80#undef NSOPTION_INTEGER
90#define DEFAULT_MARGIN_TOP_MM 10
91#define DEFAULT_MARGIN_BOTTOM_MM 10
92#define DEFAULT_MARGIN_LEFT_MM 10
93#define DEFAULT_MARGIN_RIGHT_MM 10
94#define DEFAULT_EXPORT_SCALE 0.7
96#ifndef DEFAULT_REFLOW_PERIOD
98#define DEFAULT_REFLOW_PERIOD 25
125#define NSOPTION_BOOL(NAME, DEFAULT) NSOPTION_##NAME,
126#define NSOPTION_STRING(NAME, DEFAULT) NSOPTION_##NAME,
127#define NSOPTION_INTEGER(NAME, DEFAULT) NSOPTION_##NAME,
128#define NSOPTION_UINT(NAME, DEFAULT) NSOPTION_##NAME,
129#define NSOPTION_COLOUR(NAME, DEFAULT) NSOPTION_##NAME,
139#elif defined(nsamiga)
141#elif defined(nsframebuffer)
143#elif defined(nsatari)
145#elif defined(nsmonkey)
147#elif defined(nswin32)
154#undef NSOPTION_STRING
155#undef NSOPTION_INTEGER
157#undef NSOPTION_COLOUR
304#define nsoption_bool(OPTION) (nsoptions[NSOPTION_##OPTION].value.b)
313#define nsoption_int(OPTION) (nsoptions[NSOPTION_##OPTION].value.i)
322#define nsoption_uint(OPTION) (nsoptions[NSOPTION_##OPTION].value.u)
331#define nsoption_charp(OPTION) (nsoptions[NSOPTION_##OPTION].value.s)
340#define nsoption_colour(OPTION) (nsoptions[NSOPTION_##OPTION].value.c)
344#define nsoption_set_bool(OPTION, VALUE) nsoptions[NSOPTION_##OPTION].value.b = VALUE
348#define nsoption_set_int(OPTION, VALUE) nsoptions[NSOPTION_##OPTION].value.i = VALUE
351#define nsoption_set_uint(OPTION, VALUE) nsoptions[NSOPTION_##OPTION].value.u = VALUE
355#define nsoption_set_colour(OPTION, VALUE) nsoptions[NSOPTION_##OPTION].value.c = VALUE
372#define nsoption_set_charp(OPTION, VALUE) \
373 nsoption_set_tbl_charp(nsoptions, NSOPTION_##OPTION, VALUE)
376#define nsoption_setnull_charp(OPTION, VALUE) \
378 if (nsoptions[NSOPTION_##OPTION].value.s == NULL) { \
379 nsoption_set_tbl_charp(nsoptions, NSOPTION_##OPTION, VALUE); \
Option available on all platforms.
nserror
Enumeration of error codes.
Option specific to RISC OS.
union nsoption_s::@149 value
enum nsoption_type_e type
uint32_t colour
Colour type: XBGR.
static struct nsoption_s defaults[]
The table of compiled in default options.
nserror nsoption_init(nsoption_set_default_t *set_default, struct nsoption_s **popts, struct nsoption_s **pdefs)
Initialise option system.
struct nsoption_s * nsoptions_default
global default option table.
size_t() nsoption_generate_cb(struct nsoption_s *option, void *ctx)
option generate callback
nserror nsoption_set_tbl_charp(struct nsoption_s *opts, enum nsoption_e option_idx, char *s)
Set string option in specified table.
int nsoption_snoptionf(char *string, size_t size, enum nsoption_e option, const char *fmt)
Fill a buffer with an option using a format.
nserror nsoption_generate(nsoption_generate_cb *cb, void *ctx, enum nsoption_generate_flags flags, struct nsoption_s *opts, struct nsoption_s *defs)
Generate options via acallback.
nserror nsoption_dump(FILE *outf, struct nsoption_s *opts)
Write all options to a stream.
nserror nsoption_read(const char *path, struct nsoption_s *opts)
Read choices file and set them in the passed table.
struct nsoption_s * nsoptions
global active option table.
@ OPTION_HTTP_PROXY_AUTH_NONE
@ OPTION_HTTP_PROXY_AUTH_NTLM
@ OPTION_HTTP_PROXY_AUTH_BASIC
nserror() nsoption_set_default_t(struct nsoption_s *defaults)
default setting callback.
nsoption_type_e
The options type.
@ OPTION_STRING
option is a heap allocated string.
@ OPTION_COLOUR
Option is a netsurf colour.
@ OPTION_UINT
Option is an unsigned integer.
@ OPTION_INTEGER
Option is an integer.
@ OPTION_BOOL
Option is a boolean.
nserror nsoption_commandline(int *pargc, char **argv, struct nsoption_s *opts)
Process commandline and set options approriately.
nserror nsoption_write(const char *path, struct nsoption_s *opts, struct nsoption_s *defs)
Write options that have changed from the defaults to a file.
nserror nsoption_finalise(struct nsoption_s *opts, struct nsoption_s *defs)
Finalise option system.
nsoption_generate_flags
flags to control option output in the generate call
@ NSOPTION_GENERATE_ALL
Generate output for all options.
@ NSOPTION_GENERATE_CHANGED
Generate output for options which differ from the default.
static nserror path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
Plots a path.