128
155
#define FC_SDL_DEFAULT_THEME_NAME "human"
129
156
extern char gui_sdl_default_theme_name[512];
130
157
extern bool gui_sdl_fullscreen;
131
extern int gui_sdl_screen_width;
132
extern int gui_sdl_screen_height;
158
extern struct video_mode gui_sdl_screen;
159
extern bool gui_sdl_do_cursor_animation;
160
extern bool gui_sdl_use_color_cursors;
134
162
/* gui-win32 client specific options. */
135
163
extern bool gui_win32_better_fog;
136
164
extern bool gui_win32_enable_alpha;
138
enum client_option_type {
145
enum client_option_class {
155
struct client_option; /* Opaque type. */
157
#define client_options_iterate(_p) \
159
struct client_option *_p = option_first(); \
160
for (; _p; _p = option_next(_p)) { \
162
#define client_options_iterate_end \
167
#define SPECENUM_NAME option_type
168
#define SPECENUM_VALUE0 OT_BOOLEAN
169
#define SPECENUM_VALUE1 OT_INTEGER
170
#define SPECENUM_VALUE2 OT_STRING
171
#define SPECENUM_VALUE3 OT_ENUM
172
#define SPECENUM_VALUE4 OT_BITWISE
173
#define SPECENUM_VALUE5 OT_FONT
174
#define SPECENUM_VALUE6 OT_COLOR
175
#define SPECENUM_VALUE7 OT_VIDEO_MODE
176
#include "specenum_gen.h"
179
struct option; /* Opaque type. */
180
struct option_set; /* Opaque type. */
166
183
/* Main functions. */
167
184
void options_init(void);
168
185
void options_free(void);
186
void server_options_init(void);
187
void server_options_free(void);
169
188
void options_load(void);
170
189
void options_save(void);
173
/* Option function accessors. */
174
struct client_option *option_by_number(int id);
175
struct client_option *option_by_name(const char *name);
176
struct client_option *option_first(void);
177
struct client_option *option_next(struct client_option *poption);
179
void option_set_changed_callback(struct client_option *poption,
180
void (*callback) (struct client_option *));
181
void option_changed(struct client_option *poption);
182
bool option_reset(struct client_option *poption);
184
bool option_load(struct client_option *poption, struct section_file *sf);
186
int option_number(const struct client_option *poption);
187
const char *option_name(const struct client_option *poption);
188
const char *option_description(const struct client_option *poption);
189
const char *option_help_text(const struct client_option *poption);
190
enum client_option_type option_type(const struct client_option *poption);
191
enum client_option_class option_class(const struct client_option *poption);
192
const char *option_class_name(enum client_option_class option_class);
193
extern const struct option_set const *client_optset;
194
extern const struct option_set const *server_optset;
196
struct option *optset_option_by_number(const struct option_set *poptset,
198
#define optset_option_by_index optset_option_by_number
199
struct option *optset_option_by_name(const struct option_set *poptset,
201
struct option *optset_option_first(const struct option_set *poptset);
203
int optset_category_number(const struct option_set *poptset);
204
const char *optset_category_name(const struct option_set *poptset,
208
/* Common option functions. */
209
const struct option_set *option_optset(const struct option *poption);
210
int option_number(const struct option *poption);
211
#define option_index option_number
212
const char *option_name(const struct option *poption);
213
const char *option_description(const struct option *poption);
214
const char *option_help_text(const struct option *poption);
215
enum option_type option_type(const struct option *poption);
216
int option_category(const struct option *poption);
217
const char *option_category_name(const struct option *poption);
218
bool option_is_changeable(const struct option *poption);
219
struct option *option_next(const struct option *poption);
221
bool option_reset(struct option *poption);
222
void option_set_changed_callback(struct option *poption,
223
void (*callback) (struct option *));
224
void option_changed(struct option *poption);
194
226
/* Option gui functions. */
195
void option_set_gui_data(struct client_option *poption, void *data);
196
void *option_get_gui_data(const struct client_option *poption);
198
/* Option type COT_BOOLEAN functions. */
199
bool option_bool_get(const struct client_option *poption);
200
bool option_bool_def(const struct client_option *poption);
201
bool option_bool_set(struct client_option *poption, bool val);
203
/* Option type COT_INTEGER functions. */
204
int option_int_get(const struct client_option *poption);
205
int option_int_def(const struct client_option *poption);
206
int option_int_min(const struct client_option *poption);
207
int option_int_max(const struct client_option *poption);
208
bool option_int_set(struct client_option *poption, int val);
210
/* Option type COT_STRING functions. */
211
const char *option_str_get(const struct client_option *poption);
212
const char *option_str_def(const struct client_option *poption);
213
const struct strvec *option_str_values(const struct client_option *poption);
214
bool option_str_set(struct client_option *poption, const char *str);
216
/* Option type COT_FONT functions. */
217
const char *option_font_get(const struct client_option *poption);
218
const char *option_font_def(const struct client_option *poption);
219
const char *option_font_target(const struct client_option *poption);
220
bool option_font_set(struct client_option *poption, const char *str);
227
void option_set_gui_data(struct option *poption, void *data);
228
void *option_get_gui_data(const struct option *poption);
230
/* Option type OT_BOOLEAN functions. */
231
bool option_bool_get(const struct option *poption);
232
bool option_bool_def(const struct option *poption);
233
bool option_bool_set(struct option *poption, bool val);
235
/* Option type OT_INTEGER functions. */
236
int option_int_get(const struct option *poption);
237
int option_int_def(const struct option *poption);
238
int option_int_min(const struct option *poption);
239
int option_int_max(const struct option *poption);
240
bool option_int_set(struct option *poption, int val);
242
/* Option type OT_STRING functions. */
243
const char *option_str_get(const struct option *poption);
244
const char *option_str_def(const struct option *poption);
245
const struct strvec *option_str_values(const struct option *poption);
246
bool option_str_set(struct option *poption, const char *str);
248
/* Option type OT_ENUM functions. */
249
int option_enum_str_to_int(const struct option *poption, const char *str);
250
const char *option_enum_int_to_str(const struct option *poption, int val);
251
int option_enum_get_int(const struct option *poption);
252
const char *option_enum_get_str(const struct option *poption);
253
int option_enum_def_int(const struct option *poption);
254
const char *option_enum_def_str(const struct option *poption);
255
const struct strvec *option_enum_values(const struct option *poption);
256
bool option_enum_set_int(struct option *poption, int val);
257
bool option_enum_set_str(struct option *poption, const char *str);
259
/* Option type OT_BITWISE functions. */
260
unsigned option_bitwise_get(const struct option *poption);
261
unsigned option_bitwise_def(const struct option *poption);
262
unsigned option_bitwise_mask(const struct option *poption);
263
const struct strvec *option_bitwise_values(const struct option *poption);
264
bool option_bitwise_set(struct option *poption, unsigned val);
266
/* Option type OT_FONT functions. */
267
const char *option_font_get(const struct option *poption);
268
const char *option_font_def(const struct option *poption);
269
const char *option_font_target(const struct option *poption);
270
bool option_font_set(struct option *poption, const char *font);
272
/* Option type OT_COLOR functions. */
273
struct ft_color option_color_get(const struct option *poption);
274
struct ft_color option_color_def(const struct option *poption);
275
bool option_color_set(struct option *poption, struct ft_color color);
277
/* Option type OT_VIDEO_MODE functions. */
278
struct video_mode option_video_mode_get(const struct option *poption);
279
struct video_mode option_video_mode_def(const struct option *poption);
280
bool option_video_mode_set(struct option *poption, struct video_mode mode);
283
#define options_iterate(poptset, poption) \
285
struct option *poption = optset_option_first(poptset); \
286
for (; NULL != poption; poption = option_next(poption)) { \
288
#define options_iterate_end \
223
293
/** Desired settable options. **/
224
struct options_settable;
225
294
void desired_settable_options_update(void);
226
295
void desired_settable_option_update(const char *op_name,
227
296
const char *op_value,
228
297
bool allow_replace);
229
void desired_settable_option_send(struct options_settable *pset);
232
300
/** Dialog report options. **/