Freeciv-3.3
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-5.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 /* Save size of the dialog. */
139
140 if (NULL != pdialog->shell) {
141 /* Mark as destroyed, see also option_dialog_destroy(). */
142 pdialog->shell = NULL;
143 option_dialog_destroy(pdialog);
144 }
145}
146
147/************************************************************************/
151 gpointer data)
152{
153 struct option *poption = (struct option *)data;
155
156 if (NULL != pdialog) {
158 }
159
162}
163
164/************************************************************************/
168 gpointer data)
169{
170 struct option *poption = (struct option *) data;
172
173 if (NULL != pdialog) {
175 }
176
179}
180
181/************************************************************************/
185 gpointer data)
186{
187 struct option *poption = (struct option *) data;
189
190 if (NULL != pdialog) {
192 }
193
196}
197
198/************************************************************************/
202 int n_press,
203 double x, double y,
204 gpointer data)
205{
206 struct option *poption = (struct option *) data;
209 GMenu *menu;
210 GActionGroup *group;
211 GSimpleAction *act;
212 GdkRectangle rect = { .x = x, .y = y, .width = 1, .height = 1};
213
215 return FALSE;
216 }
217
219
220 menu = g_menu_new();
221
222 act = g_simple_action_new("refresh", NULL);
225 menu_item_append_unref(menu, g_menu_item_new(_("Refresh this option"),
226 "win.refresh"));
227
228 act = g_simple_action_new("unit_reset", NULL);
231 menu_item_append_unref(menu, g_menu_item_new(_("Reset this option"),
232 "win.unit_reset"));
233
234 act = g_simple_action_new("units_apply", NULL);
238 g_menu_item_new(_("Apply the changes for this option"),
239 "win.units_apply"));
240
244
247
249
250 return TRUE;
251}
252
253/************************************************************************/
256static struct option_dialog *
258{
259 if (NULL != option_dialogs) {
260 option_dialogs_iterate(pdialog) {
261 if (pdialog->poptset == poptset) {
262 return pdialog;
263 }
265 }
266 return NULL;
267}
268
269/************************************************************************/
273{
274 GdkRGBA *color = (GdkRGBA *) data;
275
276 if (NULL != color) {
278 }
279}
280
281/************************************************************************/
285 const GdkRGBA *new_color)
286{
287 GdkRGBA *current_color = g_object_get_data(G_OBJECT(button), "color");
288 GtkWidget *child;
289
290 if (NULL == new_color) {
291 if (NULL != current_color) {
292 g_object_set_data(G_OBJECT(button), "color", NULL);
293 gtk_button_set_child(button, NULL);
294 }
295 } else {
297
298 /* Apply the new color. */
299 if (NULL != current_color) {
300 /* We already have a GdkRGBA pointer. */
302 } else {
303 /* We need to make a GdkRGBA pointer. */
307 }
308 gtk_button_set_child(button, nullptr);
309
310 /* Update the button. */
311 {
313 CAIRO_FORMAT_RGB24, 16, 16);
314 cairo_t *cr = cairo_create(surface);
315
317 cairo_paint(cr);
318 cairo_destroy(cr);
319 pixbuf = gdk_pixbuf_get_from_surface(surface, 0, 0, 16, 16);
320 cairo_surface_destroy(surface);
321 }
322
324 gtk_button_set_child(GTK_BUTTON(button), child);
327 }
328}
329
330/************************************************************************/
334 gint res, gpointer data)
335{
336 if (res == GTK_RESPONSE_REJECT) {
337 /* Clears the current color. */
339 } else if (res == GTK_RESPONSE_OK) {
340 /* Apply the new color. */
342 GTK_COLOR_CHOOSER(g_object_get_data(G_OBJECT(dialog), "chooser"));
344
347 }
348
350}
351
352/************************************************************************/
356{
357 GtkWidget *dialog, *chooser;
358 GdkRGBA *current_color = g_object_get_data(G_OBJECT(button), "color");
359
360 dialog = gtk_dialog_new_with_buttons(_("Select a color"), NULL,
362 _("_Cancel"), GTK_RESPONSE_CANCEL,
363 _("C_lear"), GTK_RESPONSE_REJECT,
364 _("_OK"), GTK_RESPONSE_OK, NULL);
365 setup_dialog(dialog, toplevel);
366 g_signal_connect(dialog, "response",
368
370 g_object_set_data(G_OBJECT(dialog), "chooser", chooser);
372 chooser, nullptr);
373 if (current_color != nullptr) {
375 }
376
378}
379
380/************************************************************************/
383static struct option_dialog *
384option_dialog_new(const char *name, const struct option_set *poptset)
385{
386 struct option_dialog *pdialog;
388
389 /* Create the dialog structure. */
390 pdialog = fc_malloc(sizeof(*pdialog));
391 pdialog->poptset = poptset;
393 _("_Cancel"), RESPONSE_CANCEL,
394 _("_Save"), RESPONSE_SAVE,
395 _("_Refresh"), RESPONSE_REFRESH,
396 _("Reset"), RESPONSE_RESET,
397 _("_Apply"), RESPONSE_APPLY,
398 _("_OK"), RESPONSE_OK, NULL);
399 pdialog->notebook = gtk_notebook_new();
400 pdialog->vboxes = fc_calloc(CATEGORY_NUM, sizeof(*pdialog->vboxes));
402 sizeof(*pdialog->box_children));
403
404 /* Append to the option dialog list. */
405 if (NULL == option_dialogs) {
407 }
409
410 /* Shell */
411 setup_dialog(pdialog->shell, toplevel);
415 g_signal_connect(pdialog->shell, "response",
417 g_signal_connect(pdialog->shell, "destroy",
419
421 pdialog->notebook, NULL);
422
423 /* Add the options. */
427
429
430 /* Show the widgets. */
432
433 return pdialog;
434}
435
436/************************************************************************/
439static void option_dialog_destroy(struct option_dialog *pdialog)
440{
441 GtkWidget *shell = pdialog->shell;
442
443 if (NULL != option_dialogs) {
445 }
446
447 options_iterate(pdialog->poptset, poption) {
450
451 if (NULL != shell) {
452 /* Maybe already destroyed, see also option_dialog_destroy_callback(). */
453 pdialog->shell = NULL;
455 }
456
457 free(pdialog->vboxes);
458 free(pdialog->box_children);
459 free(pdialog);
460}
461
462/************************************************************************/
465static int option_dialog_pages_sort_func(const void *w1, const void *w2)
466{
467 GObject *obj1 = G_OBJECT(*(GtkWidget **) w1);
468 GObject *obj2 = G_OBJECT(*(GtkWidget **) w2);
469
470 return (GPOINTER_TO_INT(g_object_get_data(obj1, "category"))
471 - GPOINTER_TO_INT(g_object_get_data(obj2, "category")));
472}
473
474/************************************************************************/
478{
481
482 if (0 < pages_num) {
483 GtkWidget *pages[pages_num];
484 int i;
485
486 for (i = 0; i < pages_num; i++) {
488 }
489 qsort(pages, pages_num, sizeof(*pages), option_dialog_pages_sort_func);
490 for (i = 0; i < pages_num; i++) {
492 }
493 }
494}
495
496/************************************************************************/
499static inline void option_dialog_foreach(struct option_dialog *pdialog,
500 void (*option_action)
501 (struct option *))
502{
503 fc_assert_ret(NULL != pdialog);
504
505 options_iterate(pdialog->poptset, poption) {
508}
509
510/************************************************************************/
513static void option_dialog_option_add(struct option_dialog *pdialog,
514 struct option *poption,
515 bool reorder_notebook)
516{
517 const int category = option_category(poption);
518 GtkWidget *main_hbox, *label, *w = NULL;
519 int main_col = 0;
522
524
525 /* Add category if needed. */
526 if (NULL == pdialog->vboxes[category]) {
527 GtkWidget *sw;
528
534 g_object_set_data(G_OBJECT(sw), "category", GINT_TO_POINTER(category));
538
539 if (reorder_notebook) {
541 }
542
543 pdialog->vboxes[category] = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
544 gtk_widget_set_margin_bottom(pdialog->vboxes[category], 8);
545 gtk_widget_set_margin_end(pdialog->vboxes[category], 8);
546 gtk_widget_set_margin_start(pdialog->vboxes[category], 8);
547 gtk_widget_set_margin_top(pdialog->vboxes[category], 8);
548 gtk_widget_set_hexpand(pdialog->vboxes[category], TRUE);
550 pdialog->vboxes[category]);
551
553 }
554 pdialog->box_children[category]++;
555
562 gtk_grid_attach(GTK_GRID(main_hbox), label, main_col++, 0, 1, 1);
567 g_signal_connect(controller, "pressed",
570 gtk_box_append(GTK_BOX(pdialog->vboxes[category]), main_hbox);
571
572 switch (option_type(poption)) {
573 case OT_BOOLEAN:
575 break;
576
577 case OT_INTEGER:
578 {
579 int min = option_int_min(poption), max = option_int_max(poption);
580
581 w = gtk_spin_button_new_with_range(min, max, MAX((max - min) / 50, 1));
582 }
583 break;
584
585 case OT_STRING:
586 {
587 const struct strvec *values = option_str_values(poption);
588
589 if (NULL != values) {
591 strvec_iterate(values, value) {
594 } else {
595 w = gtk_entry_new();
596 }
597 }
598 break;
599
600 case OT_ENUM:
601 {
602 int i;
603 const char *str;
604 GtkListStore *model;
605 GtkCellRenderer *renderer;
607
608 /* 0: enum index, 1: translated enum name. */
611 g_object_unref(model);
612
613 renderer = gtk_cell_renderer_text_new();
616 "text", 1, NULL);
617 for (i = 0; (str = option_enum_int_to_str(poption, i)); i++) {
619 gtk_list_store_set(model, &iter, 0, i, 1, _(str), -1);
620 }
621 }
622 break;
623
624 case OT_BITWISE:
625 {
626 GList *list = NULL;
627 GtkWidget *grid, *check;
628 const struct strvec *values = option_bitwise_values(poption);
629 int i;
630
631 w = gtk_frame_new(NULL);
632 grid = gtk_grid_new();
636 for (i = 0; i < strvec_size(values); i++) {
638 gtk_grid_attach(GTK_GRID(grid), check, 0, i, 1, 1);
639 label = gtk_label_new(_(strvec_get(values, i)));
640 gtk_grid_attach(GTK_GRID(grid), label, 1, i, 1, 1);
642 }
643 g_object_set_data_full(G_OBJECT(w), "check_buttons", list,
645 }
646 break;
647
648 case OT_FONT:
650 g_object_set(G_OBJECT(w), "use-font", TRUE, NULL);
651 break;
652
653 case OT_COLOR:
654 {
655 GtkWidget *button;
656 int grid_col = 0;
657
658 w = gtk_grid_new();
661
662 /* Foreground color selector button. */
663 button = gtk_button_new();
664 gtk_grid_attach(GTK_GRID(w), button, grid_col++, 0, 1, 1);
666 _("Select the text color"));
667 g_object_set_data(G_OBJECT(w), "fg_button", button);
668 g_signal_connect(button, "clicked",
670
671 /* Background color selector button. */
672 button = gtk_button_new();
673 gtk_grid_attach(GTK_GRID(w), button, grid_col++, 0, 1, 1);
675 _("Select the background color"));
676 g_object_set_data(G_OBJECT(w), "bg_button", button);
677 g_signal_connect(button, "clicked",
679 }
680 break;
681
682 case OT_VIDEO_MODE:
683 log_error("Option type %s (%d) not supported yet.",
686 break;
687 }
688
690 if (NULL == w) {
691 log_error("Failed to create a widget for option %d \"%s\".",
693 } else {
694 g_object_set_data(G_OBJECT(w), "main_widget", main_hbox);
695 g_object_set_data(G_OBJECT(w), "parent_of_main", pdialog->vboxes[category]);
699 }
700
702
703 /* Set as current value. */
705}
706
707/************************************************************************/
710static void option_dialog_option_remove(struct option_dialog *pdialog,
711 struct option *poption)
712{
714
715 if (NULL != object) {
716 const int category = option_category(poption);
717
719 gtk_box_remove(GTK_BOX(g_object_get_data(object, "parent_of_main")),
720 GTK_WIDGET(g_object_get_data(object, "main_widget")));
721
722 /* Remove category if needed. */
723 if (0 == --pdialog->box_children[category]) {
725 pdialog->vboxes[category] = NULL;
726 }
727 }
728}
729
730/************************************************************************/
734 bool value)
735{
738 value);
739}
740
741/************************************************************************/
744static inline void option_dialog_option_int_set(struct option *poption,
745 int value)
746{
748 value);
749}
750
751/************************************************************************/
754static inline void option_dialog_option_str_set(struct option *poption,
755 const char *string)
756{
758
761
763 } else {
765 }
766}
767
768/************************************************************************/
772 int value)
773{
777 int i;
778
779 if (gtk_tree_model_get_iter_first(model, &iter)) {
780 do {
781 gtk_tree_model_get(model, &iter, 0, &i, -1);
782 if (i == value) {
784 return;
785 }
786 } while (gtk_tree_model_iter_next(model, &iter));
787 }
788
789 log_error("Didn't find the value %d for option \"%s\" (nb %d).",
791}
792
793/************************************************************************/
797 unsigned value)
798{
800 GList *iter = g_object_get_data(data, "check_buttons");
801 int bit;
802
803 for (bit = 0; NULL != iter; iter = g_list_next(iter), bit++) {
805 value & (1 << bit));
806 }
807}
808
809/************************************************************************/
813 const char *font)
814{
817}
818
819/************************************************************************/
823 struct ft_color color)
824{
827
828 /* Update the foreground button. */
829 if (NULL != color.foreground
830 && '\0' != color.foreground[0]
831 && gdk_rgba_parse(&gdk_color, color.foreground)) {
833 "fg_button"),
834 &gdk_color);
835 } else {
837 "fg_button"), NULL);
838 }
839
840 /* Update the background button. */
841 if (NULL != color.background
842 && '\0' != color.background[0]
843 && gdk_rgba_parse(&gdk_color, color.background)) {
845 "bg_button"),
846 &gdk_color);
847 } else {
849 "bg_button"), NULL);
850 }
851}
852
853/************************************************************************/
890
891/************************************************************************/
925
926/************************************************************************/
930{
932
933 switch (option_type(poption)) {
934 case OT_BOOLEAN:
936 (GTK_CHECK_BUTTON(w)));
937 break;
938
939 case OT_INTEGER:
941 (GTK_SPIN_BUTTON(w)));
942 break;
943
944 case OT_STRING:
948 } else {
951 }
952 break;
953
954 case OT_ENUM:
955 {
957 int value;
958
960 break;
961 }
962
964 &iter, 0, &value, -1);
966 }
967 break;
968
969 case OT_BITWISE:
970 {
971 GList *iter = g_object_get_data(G_OBJECT(w), "check_buttons");
972 unsigned value = 0;
973 int bit;
974
975 for (bit = 0; NULL != iter; iter = g_list_next(iter), bit++) {
977 value |= 1 << bit;
978 }
979 }
981 }
982 break;
983
984 case OT_FONT:
986 (GTK_FONT_CHOOSER(w)));
987 break;
988
989 case OT_COLOR:
990 {
992 GObject *button;
993 GdkRGBA *color;
994
995 /* Get foreground color. */
996 button = g_object_get_data(G_OBJECT(w), "fg_button");
997 color = g_object_get_data(button, "color");
999
1000 /* Get background color. */
1001 button = g_object_get_data(G_OBJECT(w), "bg_button");
1002 color = g_object_get_data(button, "color");
1004
1009 }
1010 break;
1011
1012 case OT_VIDEO_MODE:
1013 log_error("Option type %s (%d) not supported yet.",
1016 break;
1017 }
1018}
1019
1020/************************************************************************/
1023void option_dialog_popup(const char *name, const struct option_set *poptset)
1024{
1025 struct option_dialog *pdialog = option_dialog_get(poptset);
1026
1027 if (NULL != pdialog) {
1029 } else {
1031 }
1032}
1033
1034/************************************************************************/
1038{
1039 struct option_dialog *pdialog = option_dialog_get(poptset);
1040
1041 if (NULL != pdialog) {
1042 option_dialog_destroy(pdialog);
1043 }
1044}
1045
1046/************************************************************************/
1051{
1053 if (strcmp(option_name(poption), "aifill") == 0) {
1055 } else if (strcmp(option_name(poption), "nationset") == 0) {
1057 }
1058 }
1059}
1060
1061/************************************************************************/
1065{
1067
1068 if (NULL != pdialog) {
1070 }
1071
1073}
1074
1075/************************************************************************/
1079{
1081
1082 if (NULL != pdialog) {
1084 }
1085
1087}
1088
1089/************************************************************************/
1093{
1095
1096 if (NULL != pdialog) {
1098 }
1099}
#define str
Definition astring.c:76
static struct fc_sockaddr_list * list
Definition clinet.c:102
char * incite_cost
Definition comments.c:76
#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:126
#define GUI_GTK_OPTION(optname)
Definition gui_main.h:32
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:309
static struct option_dialog * option_dialog_get(const struct option_set *poptset)
Definition optiondlg.c:231
void option_gui_remove(struct option *poption)
Definition optiondlg.c:1053
static void option_dialog_option_refresh(struct option *poption)
Definition optiondlg.c:818
void option_dialog_popdown(const struct option_set *poptset)
Definition optiondlg.c:998
static void option_dialog_option_color_set(struct option *poption, struct ft_color color)
Definition optiondlg.c:784
static void option_color_set_button_color(GtkButton *button, const GdkRGBA *new_color)
Definition optiondlg.c:258
static void option_dialog_option_add(struct option_dialog *pdialog, struct option *poption, bool reorder_notebook)
Definition optiondlg.c:491
#define option_dialogs_iterate_end
Definition optiondlg.c:55
static void option_dialog_option_bitwise_set(struct option *poption, unsigned value)
Definition optiondlg.c:758
static void option_dialog_destroy(struct option_dialog *pdialog)
Definition optiondlg.c:417
static void option_dialog_option_bool_set(struct option *poption, bool value)
Definition optiondlg.c:698
@ 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_remove(struct option_dialog *pdialog, struct option *poption)
Definition optiondlg.c:676
void option_gui_add(struct option *poption)
Definition optiondlg.c:1039
static void option_color_select_callback(GtkButton *button, gpointer data)
Definition optiondlg.c:331
static void option_dialog_option_int_set(struct option *poption, int value)
Definition optiondlg.c:709
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:1011
static void option_apply_callback(GtkMenuItem *menuitem, gpointer data)
Definition optiondlg.c:179
static void option_color_destroy_notify(gpointer data)
Definition optiondlg.c:246
static void option_dialog_option_font_set(struct option *poption, const char *font)
Definition optiondlg.c:774
void option_gui_update(struct option *poption)
Definition optiondlg.c:1025
static int option_dialog_pages_sort_func(const void *w1, const void *w2)
Definition optiondlg.c:443
void option_dialog_popup(const char *name, const struct option_set *poptset)
Definition optiondlg.c:984
static void option_dialog_reorder_notebook(struct option_dialog *pdialog)
Definition optiondlg.c:455
static void option_dialog_option_apply(struct option *poption)
Definition optiondlg.c:891
static gboolean option_button_press_callback(GtkWidget *widget, GdkEventButton *event, gpointer data)
Definition optiondlg.c:192
static void option_dialog_option_reset(struct option *poption)
Definition optiondlg.c:856
static void option_reset_callback(GtkMenuItem *menuitem, gpointer data)
Definition optiondlg.c:166
static void option_dialog_foreach(struct option_dialog *pdialog, void(*option_action)(struct option *))
Definition optiondlg.c:477
static void option_dialog_option_str_set(struct option *poption, const char *string)
Definition optiondlg.c:719
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:733
static void option_refresh_callback(GtkMenuItem *menuitem, gpointer data)
Definition optiondlg.c:153
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:192
#define fc_assert(condition)
Definition log.h:177
#define log_error(message,...)
Definition log.h:104
#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:966
unsigned option_bitwise_def(const struct option *poption)
Definition options.c:1136
int option_int_min(const struct option *poption)
Definition options.c:907
bool option_bool_def(const struct option *poption)
Definition options.c:859
const char * option_font_def(const struct option *poption)
Definition options.c:1203
const struct option_set * server_optset
Definition options.c:4369
const char * option_description(const struct option *poption)
Definition options.c:689
const char * option_help_text(const struct option *poption)
Definition options.c:699
struct ft_color option_color_get(const struct option *poption)
Definition options.c:1241
int option_enum_get_int(const struct option *poption)
Definition options.c:1031
int option_number(const struct option *poption)
Definition options.c:669
int option_category(const struct option *poption)
Definition options.c:719
bool option_str_set(struct option *poption, const char *str)
Definition options.c:977
const char * option_name(const struct option *poption)
Definition options.c:679
int option_int_get(const struct option *poption)
Definition options.c:885
bool option_color_set(struct option *poption, struct ft_color color)
Definition options.c:1264
bool option_bool_set(struct option *poption, bool val)
Definition options.c:870
bool option_is_changeable(const struct option *poption)
Definition options.c:740
void option_set_gui_data(struct option *poption, void *data)
Definition options.c:818
const char * option_str_get(const struct option *poption)
Definition options.c:944
void * option_get_gui_data(const struct option *poption)
Definition options.c:828
bool option_enum_set_int(struct option *poption, int val)
Definition options.c:1091
bool option_bool_get(const struct option *poption)
Definition options.c:848
int optset_category_number(const struct option_set *poptset)
Definition options.c:508
enum option_type option_type(const struct option *poption)
Definition options.c:709
const char * option_enum_int_to_str(const struct option *poption, int val)
Definition options.c:1016
const struct option_set * option_optset(const struct option *poption)
Definition options.c:659
const char * option_str_def(const struct option *poption)
Definition options.c:955
int option_int_max(const struct option *poption)
Definition options.c:918
bool option_font_set(struct option *poption, const char *font)
Definition options.c:1225
void queue_options_save(option_save_log_callback log_cb)
Definition options.c:6441
const struct strvec * option_bitwise_values(const struct option *poption)
Definition options.c:1164
bool option_bitwise_set(struct option *poption, unsigned val)
Definition options.c:1175
const char * option_font_get(const struct option *poption)
Definition options.c:1192
struct ft_color option_color_def(const struct option *poption)
Definition options.c:1252
unsigned option_bitwise_get(const struct option *poption)
Definition options.c:1125
int option_enum_def_int(const struct option *poption)
Definition options.c:1055
bool option_int_set(struct option *poption, int val)
Definition options.c:929
const char * option_category_name(const struct option *poption)
Definition options.c:729
int option_int_def(const struct option *poption)
Definition options.c:896
#define options_iterate(poptset, poption)
Definition options.h:602
#define options_iterate_end
Definition options.h:607
#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