Freeciv-3.2
Loading...
Searching...
No Matches
optiondlg.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <stdlib.h>
19
20#include <gtk/gtk.h>
21
22/* utility */
23#include "log.h"
24#include "mem.h"
25#include "string_vector.h"
26
27/* client */
28#include "options.h"
29
30/* client/gui-gtk-4.0 */
31#include "colors.h"
32#include "dialogs.h"
33#include "gui_main.h"
34#include "gui_stuff.h"
35#include "pages.h"
36
37#include "optiondlg.h"
38
39
40/* The option dialog data. */
41struct option_dialog {
42 const struct option_set *poptset; /* The option set. */
43 GtkWidget *shell; /* The main widget. */
44 GtkWidget *notebook; /* The notebook. */
45 GtkWidget **vboxes; /* Category boxes. */
46 int *box_children; /* The number of children for
47 * each category. */
48};
49
50#define SPECLIST_TAG option_dialog
51#define SPECLIST_TYPE struct option_dialog
52#include "speclist.h"
53#define option_dialogs_iterate(pdialog) \
54 TYPED_LIST_ITERATE(struct option_dialog, option_dialogs, pdialog)
55#define option_dialogs_iterate_end LIST_ITERATE_END
56
57/* All option dialog are set on this list. */
59
60enum {
67};
68
70
71
72/* Option dialog main functions. */
73static struct option_dialog *
75static struct option_dialog *
76option_dialog_new(const char *name, const struct option_set *poptset);
77static void option_dialog_destroy(struct option_dialog *pdialog);
78
79static void option_dialog_reorder_notebook(struct option_dialog *pdialog);
80static inline void option_dialog_foreach(struct option_dialog *pdialog,
81 void (*option_action)
82 (struct option *));
83
84/* Option dialog option-specific functions. */
85static void option_dialog_option_add(struct option_dialog *pdialog,
86 struct option *poption,
87 bool reorder_notebook);
88static void option_dialog_option_remove(struct option_dialog *pdialog,
89 struct option *poption);
90
92static void option_dialog_option_reset(struct option *poption);
93static void option_dialog_option_apply(struct option *poption);
94
95
96/************************************************************************/
101{
102 struct option_dialog *pdialog = (struct option_dialog *) data;
103
104 switch (response_id) {
105 case RESPONSE_CANCEL:
107 break;
108 case RESPONSE_OK:
111 break;
112 case RESPONSE_APPLY:
114 break;
115 case RESPONSE_RESET:
117 break;
118 case RESPONSE_REFRESH:
120 break;
121 case RESPONSE_SAVE:
124 break;
125 }
126}
127
128/************************************************************************/
132{
133 struct option_dialog *pdialog = (struct option_dialog *) data;
134
135 if (NULL != pdialog->shell) {
136 /* Mark as destroyed, see also option_dialog_destroy(). */
137 pdialog->shell = NULL;
138 option_dialog_destroy(pdialog);
139 }
140}
141
142/************************************************************************/
146 gpointer data)
147{
148 struct option *poption = (struct option *)data;
150
151 if (NULL != pdialog) {
153 }
154
157}
158
159/************************************************************************/
163 gpointer data)
164{
165 struct option *poption = (struct option *) data;
167
168 if (NULL != pdialog) {
170 }
171
174}
175
176/************************************************************************/
180 gpointer data)
181{
182 struct option *poption = (struct option *) data;
184
185 if (NULL != pdialog) {
187 }
188
191}
192
193/************************************************************************/
197 int n_press,
198 double x, double y,
199 gpointer data)
200{
201 struct option *poption = (struct option *) data;
204 GMenu *menu;
205 GActionGroup *group;
206 GSimpleAction *act;
207 GdkRectangle rect = { .x = x, .y = y, .width = 1, .height = 1};
208
210 return FALSE;
211 }
212
214
215 menu = g_menu_new();
216
217 act = g_simple_action_new("refresh", NULL);
220 menu_item_append_unref(menu, g_menu_item_new(_("Refresh this option"),
221 "win.refresh"));
222
223 act = g_simple_action_new("unit_reset", NULL);
226 menu_item_append_unref(menu, g_menu_item_new(_("Reset this option"),
227 "win.unit_reset"));
228
229 act = g_simple_action_new("units_apply", NULL);
233 g_menu_item_new(_("Apply the changes for this option"),
234 "win.units_apply"));
235
239
242
244
245 return TRUE;
246}
247
248/************************************************************************/
251static struct option_dialog *
253{
254 if (NULL != option_dialogs) {
255 option_dialogs_iterate(pdialog) {
256 if (pdialog->poptset == poptset) {
257 return pdialog;
258 }
260 }
261 return NULL;
262}
263
264/************************************************************************/
268{
269 GdkRGBA *color = (GdkRGBA *) data;
270
271 if (NULL != color) {
273 }
274}
275
276/************************************************************************/
280 const GdkRGBA *new_color)
281{
282 GdkRGBA *current_color = g_object_get_data(G_OBJECT(button), "color");
283 GtkWidget *child;
284
285 if (NULL == new_color) {
286 if (NULL != current_color) {
287 g_object_set_data(G_OBJECT(button), "color", NULL);
288 gtk_button_set_child(button, NULL);
289 }
290 } else {
292
293 /* Apply the new color. */
294 if (NULL != current_color) {
295 /* We already have a GdkRGBA pointer. */
297 } else {
298 /* We need to make a GdkRGBA pointer. */
302 }
303 gtk_button_set_child(button, NULL);
304
305 /* Update the button. */
306 {
308 CAIRO_FORMAT_RGB24, 16, 16);
309 cairo_t *cr = cairo_create(surface);
310
312 cairo_paint(cr);
313 cairo_destroy(cr);
314 pixbuf = gdk_pixbuf_get_from_surface(surface, 0, 0, 16, 16);
315 cairo_surface_destroy(surface);
316 }
317
319 gtk_button_set_child(GTK_BUTTON(button), child);
322 }
323}
324
325/************************************************************************/
329 gint res, gpointer data)
330{
331 if (res == GTK_RESPONSE_REJECT) {
332 /* Clears the current color. */
334 } else if (res == GTK_RESPONSE_OK) {
335 /* Apply the new color. */
337 GTK_COLOR_CHOOSER(g_object_get_data(G_OBJECT(dialog), "chooser"));
339
342 }
343
345}
346
347/************************************************************************/
351{
352 GtkWidget *dialog, *chooser;
353 GdkRGBA *current_color = g_object_get_data(G_OBJECT(button), "color");
354
355 dialog = gtk_dialog_new_with_buttons(_("Select a color"), NULL,
357 _("_Cancel"), GTK_RESPONSE_CANCEL,
358 _("C_lear"), GTK_RESPONSE_REJECT,
359 _("_OK"), GTK_RESPONSE_OK, NULL);
360 setup_dialog(dialog, toplevel);
361 g_signal_connect(dialog, "response",
363
365 g_object_set_data(G_OBJECT(dialog), "chooser", chooser);
367 chooser, NULL);
368 if (current_color != NULL) {
370 }
371
373}
374
375/************************************************************************/
378static struct option_dialog *
379option_dialog_new(const char *name, const struct option_set *poptset)
380{
381 struct option_dialog *pdialog;
383
384 /* Create the dialog structure. */
385 pdialog = fc_malloc(sizeof(*pdialog));
386 pdialog->poptset = poptset;
388 _("_Cancel"), RESPONSE_CANCEL,
389 _("_Save"), RESPONSE_SAVE,
390 _("_Refresh"), RESPONSE_REFRESH,
391 _("Reset"), RESPONSE_RESET,
392 _("_Apply"), RESPONSE_APPLY,
393 _("_OK"), RESPONSE_OK, NULL);
394 pdialog->notebook = gtk_notebook_new();
395 pdialog->vboxes = fc_calloc(CATEGORY_NUM, sizeof(*pdialog->vboxes));
397 sizeof(*pdialog->box_children));
398
399 /* Append to the option dialog list. */
400 if (NULL == option_dialogs) {
402 }
404
405 /* Shell */
406 setup_dialog(pdialog->shell, toplevel);
407 gtk_window_set_default_size(GTK_WINDOW(pdialog->shell), -1, 480);
408 g_signal_connect(pdialog->shell, "response",
410 g_signal_connect(pdialog->shell, "destroy",
412
414 pdialog->notebook, NULL);
415
416 /* Add the options. */
420
422
423 /* Show the widgets. */
425
426 return pdialog;
427}
428
429/************************************************************************/
432static void option_dialog_destroy(struct option_dialog *pdialog)
433{
434 GtkWidget *shell = pdialog->shell;
435
436 if (NULL != option_dialogs) {
438 }
439
440 options_iterate(pdialog->poptset, poption) {
443
444 if (NULL != shell) {
445 /* Maybe already destroyed, see also option_dialog_destroy_callback(). */
446 pdialog->shell = NULL;
448 }
449
450 free(pdialog->vboxes);
451 free(pdialog->box_children);
452 free(pdialog);
453}
454
455/************************************************************************/
458static int option_dialog_pages_sort_func(const void *w1, const void *w2)
459{
460 GObject *obj1 = G_OBJECT(*(GtkWidget **) w1);
461 GObject *obj2 = G_OBJECT(*(GtkWidget **) w2);
462
463 return (GPOINTER_TO_INT(g_object_get_data(obj1, "category"))
464 - GPOINTER_TO_INT(g_object_get_data(obj2, "category")));
465}
466
467/************************************************************************/
471{
474
475 if (0 < pages_num) {
476 GtkWidget *pages[pages_num];
477 int i;
478
479 for (i = 0; i < pages_num; i++) {
481 }
482 qsort(pages, pages_num, sizeof(*pages), option_dialog_pages_sort_func);
483 for (i = 0; i < pages_num; i++) {
485 }
486 }
487}
488
489/************************************************************************/
492static inline void option_dialog_foreach(struct option_dialog *pdialog,
493 void (*option_action)
494 (struct option *))
495{
496 fc_assert_ret(NULL != pdialog);
497
498 options_iterate(pdialog->poptset, poption) {
501}
502
503/************************************************************************/
506static void option_dialog_option_add(struct option_dialog *pdialog,
507 struct option *poption,
508 bool reorder_notebook)
509{
510 const int category = option_category(poption);
511 GtkWidget *main_hbox, *label, *w = NULL;
512 int main_col = 0;
515
517
518 /* Add category if needed. */
519 if (NULL == pdialog->vboxes[category]) {
520 GtkWidget *sw;
521
527 g_object_set_data(G_OBJECT(sw), "category", GINT_TO_POINTER(category));
531
532 if (reorder_notebook) {
534 }
535
536 pdialog->vboxes[category] = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
537 gtk_widget_set_margin_bottom(pdialog->vboxes[category], 8);
538 gtk_widget_set_margin_end(pdialog->vboxes[category], 8);
539 gtk_widget_set_margin_start(pdialog->vboxes[category], 8);
540 gtk_widget_set_margin_top(pdialog->vboxes[category], 8);
541 gtk_widget_set_hexpand(pdialog->vboxes[category], TRUE);
543 pdialog->vboxes[category]);
544
546 }
547 pdialog->box_children[category]++;
548
555 gtk_grid_attach(GTK_GRID(main_hbox), label, main_col++, 0, 1, 1);
560 g_signal_connect(controller, "pressed",
563 gtk_box_append(GTK_BOX(pdialog->vboxes[category]), main_hbox);
564
565 switch (option_type(poption)) {
566 case OT_BOOLEAN:
568 break;
569
570 case OT_INTEGER:
571 {
572 int min = option_int_min(poption), max = option_int_max(poption);
573
574 w = gtk_spin_button_new_with_range(min, max, MAX((max - min) / 50, 1));
575 }
576 break;
577
578 case OT_STRING:
579 {
580 const struct strvec *values = option_str_values(poption);
581
582 if (NULL != values) {
584 strvec_iterate(values, value) {
587 } else {
588 w = gtk_entry_new();
589 }
590 }
591 break;
592
593 case OT_ENUM:
594 {
595 int i;
596 const char *str;
597 GtkListStore *model;
598 GtkCellRenderer *renderer;
600
601 /* 0: enum index, 1: translated enum name. */
604 g_object_unref(model);
605
606 renderer = gtk_cell_renderer_text_new();
609 "text", 1, NULL);
610 for (i = 0; (str = option_enum_int_to_str(poption, i)); i++) {
612 gtk_list_store_set(model, &iter, 0, i, 1, _(str), -1);
613 }
614 }
615 break;
616
617 case OT_BITWISE:
618 {
619 GList *list = NULL;
620 GtkWidget *grid, *check;
621 const struct strvec *values = option_bitwise_values(poption);
622 int i;
623
624 w = gtk_frame_new(NULL);
625 grid = gtk_grid_new();
629 for (i = 0; i < strvec_size(values); i++) {
631 gtk_grid_attach(GTK_GRID(grid), check, 0, i, 1, 1);
632 label = gtk_label_new(_(strvec_get(values, i)));
633 gtk_grid_attach(GTK_GRID(grid), label, 1, i, 1, 1);
635 }
636 g_object_set_data_full(G_OBJECT(w), "check_buttons", list,
638 }
639 break;
640
641 case OT_FONT:
643 g_object_set(G_OBJECT(w), "use-font", TRUE, NULL);
644 break;
645
646 case OT_COLOR:
647 {
648 GtkWidget *button;
649 int grid_col = 0;
650
651 w = gtk_grid_new();
654
655 /* Foreground color selector button. */
656 button = gtk_button_new();
657 gtk_grid_attach(GTK_GRID(w), button, grid_col++, 0, 1, 1);
659 _("Select the text color"));
660 g_object_set_data(G_OBJECT(w), "fg_button", button);
661 g_signal_connect(button, "clicked",
663
664 /* Background color selector button. */
665 button = gtk_button_new();
666 gtk_grid_attach(GTK_GRID(w), button, grid_col++, 0, 1, 1);
668 _("Select the background color"));
669 g_object_set_data(G_OBJECT(w), "bg_button", button);
670 g_signal_connect(button, "clicked",
672 }
673 break;
674
675 case OT_VIDEO_MODE:
676 log_error("Option type %s (%d) not supported yet.",
679 break;
680 }
681
683 if (NULL == w) {
684 log_error("Failed to create a widget for option %d \"%s\".",
686 } else {
687 g_object_set_data(G_OBJECT(w), "main_widget", main_hbox);
688 g_object_set_data(G_OBJECT(w), "parent_of_main", pdialog->vboxes[category]);
692 }
693
695
696 /* Set as current value. */
698}
699
700/************************************************************************/
703static void option_dialog_option_remove(struct option_dialog *pdialog,
704 struct option *poption)
705{
707
708 if (NULL != object) {
709 const int category = option_category(poption);
710
712 gtk_box_remove(GTK_BOX(g_object_get_data(object, "parent_of_main")),
713 GTK_WIDGET(g_object_get_data(object, "main_widget")));
714
715 /* Remove category if needed. */
716 if (0 == --pdialog->box_children[category]) {
718 pdialog->vboxes[category] = NULL;
719 }
720 }
721}
722
723/************************************************************************/
727 bool value)
728{
731 value);
732}
733
734/************************************************************************/
737static inline void option_dialog_option_int_set(struct option *poption,
738 int value)
739{
741 value);
742}
743
744/************************************************************************/
747static inline void option_dialog_option_str_set(struct option *poption,
748 const char *string)
749{
751
754
756 } else {
758 }
759}
760
761/************************************************************************/
765 int value)
766{
770 int i;
771
772 if (gtk_tree_model_get_iter_first(model, &iter)) {
773 do {
774 gtk_tree_model_get(model, &iter, 0, &i, -1);
775 if (i == value) {
777 return;
778 }
779 } while (gtk_tree_model_iter_next(model, &iter));
780 }
781
782 log_error("Didn't find the value %d for option \"%s\" (nb %d).",
784}
785
786/************************************************************************/
790 unsigned value)
791{
793 GList *iter = g_object_get_data(data, "check_buttons");
794 int bit;
795
796 for (bit = 0; NULL != iter; iter = g_list_next(iter), bit++) {
798 value & (1 << bit));
799 }
800}
801
802/************************************************************************/
806 const char *font)
807{
810}
811
812/************************************************************************/
816 struct ft_color color)
817{
820
821 /* Update the foreground button. */
822 if (NULL != color.foreground
823 && '\0' != color.foreground[0]
824 && gdk_rgba_parse(&gdk_color, color.foreground)) {
826 "fg_button"),
827 &gdk_color);
828 } else {
830 "fg_button"), NULL);
831 }
832
833 /* Update the background button. */
834 if (NULL != color.background
835 && '\0' != color.background[0]
836 && gdk_rgba_parse(&gdk_color, color.background)) {
838 "bg_button"),
839 &gdk_color);
840 } else {
842 "bg_button"), NULL);
843 }
844}
845
846/************************************************************************/
883
884/************************************************************************/
918
919/************************************************************************/
923{
925
926 switch (option_type(poption)) {
927 case OT_BOOLEAN:
929 (GTK_CHECK_BUTTON(w)));
930 break;
931
932 case OT_INTEGER:
934 (GTK_SPIN_BUTTON(w)));
935 break;
936
937 case OT_STRING:
941 } else {
944 }
945 break;
946
947 case OT_ENUM:
948 {
950 int value;
951
953 break;
954 }
955
957 &iter, 0, &value, -1);
959 }
960 break;
961
962 case OT_BITWISE:
963 {
964 GList *iter = g_object_get_data(G_OBJECT(w), "check_buttons");
965 unsigned value = 0;
966 int bit;
967
968 for (bit = 0; NULL != iter; iter = g_list_next(iter), bit++) {
970 value |= 1 << bit;
971 }
972 }
974 }
975 break;
976
977 case OT_FONT:
979 (GTK_FONT_CHOOSER(w)));
980 break;
981
982 case OT_COLOR:
983 {
985 GObject *button;
986 GdkRGBA *color;
987
988 /* Get foreground color. */
989 button = g_object_get_data(G_OBJECT(w), "fg_button");
990 color = g_object_get_data(button, "color");
992
993 /* Get background color. */
994 button = g_object_get_data(G_OBJECT(w), "bg_button");
995 color = g_object_get_data(button, "color");
997
1002 }
1003 break;
1004
1005 case OT_VIDEO_MODE:
1006 log_error("Option type %s (%d) not supported yet.",
1009 break;
1010 }
1011}
1012
1013/************************************************************************/
1016void option_dialog_popup(const char *name, const struct option_set *poptset)
1017{
1018 struct option_dialog *pdialog = option_dialog_get(poptset);
1019
1020 if (NULL != pdialog) {
1022 } else {
1024 }
1025}
1026
1027/************************************************************************/
1031{
1032 struct option_dialog *pdialog = option_dialog_get(poptset);
1033
1034 if (NULL != pdialog) {
1035 option_dialog_destroy(pdialog);
1036 }
1037}
1038
1039/************************************************************************/
1044{
1046 if (strcmp(option_name(poption), "aifill") == 0) {
1048 } else if (strcmp(option_name(poption), "nationset") == 0) {
1050 }
1051 }
1052}
1053
1054/************************************************************************/
1058{
1060
1061 if (NULL != pdialog) {
1063 }
1064
1066}
1067
1068/************************************************************************/
1072{
1074
1075 if (NULL != pdialog) {
1077 }
1078
1080}
1081
1082/************************************************************************/
1086{
1088
1089 if (NULL != pdialog) {
1091 }
1092}
#define str
Definition astring.c:76
static struct fc_sockaddr_list * list
Definition clinet.c:102
char * incite_cost
Definition comments.c:75
#define _(String)
Definition fcintl.h:67
static struct ft_color ft_color_construct(const char *foreground, const char *background)
void nationset_sync_to_server(const char *nationset)
Definition dialogs.c:801
GtkWidget * toplevel
Definition gui_main.c:125
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:287
static struct gui_dialog * shell
Definition messagedlg.c:39
static void option_dialog_destroy_callback(GtkWidget *object, gpointer data)
Definition optiondlg.c:129
static void color_selector_response_callback(GtkDialog *dialog, gint res, gpointer data)
Definition optiondlg.c:299
static struct option_dialog * option_dialog_get(const struct option_set *poptset)
Definition optiondlg.c:221
void option_gui_remove(struct option *poption)
Definition optiondlg.c:1041
static void option_dialog_option_refresh(struct option *poption)
Definition optiondlg.c:806
void option_dialog_popdown(const struct option_set *poptset)
Definition optiondlg.c:986
static void option_dialog_option_color_set(struct option *poption, struct ft_color color)
Definition optiondlg.c:772
static void option_color_set_button_color(GtkButton *button, const GdkRGBA *new_color)
Definition optiondlg.c:248
static void option_dialog_option_add(struct option_dialog *pdialog, struct option *poption, bool reorder_notebook)
Definition optiondlg.c:479
#define option_dialogs_iterate_end
Definition optiondlg.c:55
static void option_dialog_option_bitwise_set(struct option *poption, unsigned value)
Definition optiondlg.c:746
static void option_dialog_destroy(struct option_dialog *pdialog)
Definition optiondlg.c:405
static void option_dialog_option_bool_set(struct option *poption, bool value)
Definition optiondlg.c:686
static void option_dialog_option_remove(struct option_dialog *pdialog, struct option *poption)
Definition optiondlg.c:664
void option_gui_add(struct option *poption)
Definition optiondlg.c:1027
static void option_color_select_callback(GtkButton *button, gpointer data)
Definition optiondlg.c:321
static void option_dialog_option_int_set(struct option *poption, int value)
Definition optiondlg.c:697
static void option_dialog_reponse_callback(GtkDialog *dialog, gint response_id, gpointer data)
Definition optiondlg.c:97
#define option_dialogs_iterate(pdialog)
Definition optiondlg.c:53
static void option_gui_update_extra(struct option *poption)
Definition optiondlg.c:999
static void option_apply_callback(GtkMenuItem *menuitem, gpointer data)
Definition optiondlg.c:169
static void option_color_destroy_notify(gpointer data)
Definition optiondlg.c:236
@ RESPONSE_SAVE
Definition optiondlg.c:66
@ RESPONSE_APPLY
Definition optiondlg.c:63
@ RESPONSE_CANCEL
Definition optiondlg.c:61
@ RESPONSE_OK
Definition optiondlg.c:62
@ RESPONSE_RESET
Definition optiondlg.c:64
@ RESPONSE_REFRESH
Definition optiondlg.c:65
static void option_dialog_option_font_set(struct option *poption, const char *font)
Definition optiondlg.c:762
void option_gui_update(struct option *poption)
Definition optiondlg.c:1013
static int option_dialog_pages_sort_func(const void *w1, const void *w2)
Definition optiondlg.c:431
void option_dialog_popup(const char *name, const struct option_set *poptset)
Definition optiondlg.c:972
static void option_dialog_reorder_notebook(struct option_dialog *pdialog)
Definition optiondlg.c:443
static void option_dialog_option_apply(struct option *poption)
Definition optiondlg.c:879
static gboolean option_button_press_callback(GtkWidget *widget, GdkEventButton *event, gpointer data)
Definition optiondlg.c:182
static void option_dialog_option_reset(struct option *poption)
Definition optiondlg.c:844
static void option_reset_callback(GtkMenuItem *menuitem, gpointer data)
Definition optiondlg.c:156
static void option_dialog_foreach(struct option_dialog *pdialog, void(*option_action)(struct option *))
Definition optiondlg.c:465
static void option_dialog_option_str_set(struct option *poption, const char *string)
Definition optiondlg.c:707
static struct option_dialog_list * option_dialogs
Definition optiondlg.c:58
static void option_dialog_option_enum_set(struct option *poption, int value)
Definition optiondlg.c:721
static void option_refresh_callback(GtkMenuItem *menuitem, gpointer data)
Definition optiondlg.c:143
void ai_fill_changed_by_server(int aifill)
Definition pages.c:1653
#define menu_item_append_unref(menu, item)
Definition gui_stuff.h:149
static GtkWidget * opt_popover
Definition optiondlg.c:69
static struct option_dialog * option_dialog_new(void)
Definition optiondlg.c:788
const char * name
Definition inputfile.c:127
#define fc_assert_ret(condition)
Definition log.h:191
#define fc_assert(condition)
Definition log.h:176
#define log_error(message,...)
Definition log.h:103
#define fc_calloc(n, esz)
Definition mem.h:38
#define fc_malloc(sz)
Definition mem.h:34
const struct strvec * option_str_values(const struct option *poption)
Definition options.c:915
unsigned option_bitwise_def(const struct option *poption)
Definition options.c:1085
int option_int_min(const struct option *poption)
Definition options.c:856
bool option_bool_def(const struct option *poption)
Definition options.c:808
const char * option_font_def(const struct option *poption)
Definition options.c:1152
const struct option_set * server_optset
Definition options.c:4016
const char * option_description(const struct option *poption)
Definition options.c:638
const char * option_help_text(const struct option *poption)
Definition options.c:648
struct ft_color option_color_get(const struct option *poption)
Definition options.c:1190
int option_enum_get_int(const struct option *poption)
Definition options.c:980
int option_number(const struct option *poption)
Definition options.c:618
int option_category(const struct option *poption)
Definition options.c:668
bool option_str_set(struct option *poption, const char *str)
Definition options.c:926
const char * option_name(const struct option *poption)
Definition options.c:628
int option_int_get(const struct option *poption)
Definition options.c:834
bool option_color_set(struct option *poption, struct ft_color color)
Definition options.c:1213
bool option_bool_set(struct option *poption, bool val)
Definition options.c:819
bool option_is_changeable(const struct option *poption)
Definition options.c:689
void option_set_gui_data(struct option *poption, void *data)
Definition options.c:767
const char * option_str_get(const struct option *poption)
Definition options.c:893
void * option_get_gui_data(const struct option *poption)
Definition options.c:777
bool option_enum_set_int(struct option *poption, int val)
Definition options.c:1040
bool option_bool_get(const struct option *poption)
Definition options.c:797
int optset_category_number(const struct option_set *poptset)
Definition options.c:457
enum option_type option_type(const struct option *poption)
Definition options.c:658
const char * option_enum_int_to_str(const struct option *poption, int val)
Definition options.c:965
const struct option_set * option_optset(const struct option *poption)
Definition options.c:608
const char * option_str_def(const struct option *poption)
Definition options.c:904
int option_int_max(const struct option *poption)
Definition options.c:867
bool option_font_set(struct option *poption, const char *font)
Definition options.c:1174
void options_save(option_save_log_callback log_cb)
Definition options.c:6089
const struct strvec * option_bitwise_values(const struct option *poption)
Definition options.c:1113
bool option_bitwise_set(struct option *poption, unsigned val)
Definition options.c:1124
const char * option_font_get(const struct option *poption)
Definition options.c:1141
void desired_settable_options_update(void)
Definition options.c:5543
struct ft_color option_color_def(const struct option *poption)
Definition options.c:1201
unsigned option_bitwise_get(const struct option *poption)
Definition options.c:1074
int option_enum_def_int(const struct option *poption)
Definition options.c:1004
bool option_int_set(struct option *poption, int val)
Definition options.c:878
const char * option_category_name(const struct option *poption)
Definition options.c:678
int option_int_def(const struct option *poption)
Definition options.c:845
#define options_iterate(poptset, poption)
Definition options.h:550
#define options_iterate_end
Definition options.h:555
#define MAX(x, y)
Definition shared.h:54
struct sprite int int y
Definition sprite_g.h:31
struct sprite int x
Definition sprite_g.h:31
const char * strvec_get(const struct strvec *psv, size_t svindex)
size_t strvec_size(const struct strvec *psv)
#define strvec_iterate(psv, str)
#define strvec_iterate_end
Definition colors.h:21
int * box_children
Definition optiondlg.c:46
GtkWidget ** vboxes
Definition optiondlg.c:45
GtkWidget * shell
Definition optiondlg.c:43
const struct option_set * poptset
Definition optiondlg.c:42
GtkWidget * notebook
Definition optiondlg.c:44
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47