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
39static int opt_dlog_width = -1, opt_dlog_height = 480;
40
41/* The option dialog data. */
42struct option_dialog {
43 const struct option_set *poptset; /* The option set. */
44 GtkWidget *shell; /* The main widget. */
45 GtkWidget *notebook; /* The notebook. */
46 GtkWidget **vboxes; /* Category boxes. */
47 int *box_children; /* The number of children for
48 * each category. */
49};
50
51#define SPECLIST_TAG option_dialog
52#define SPECLIST_TYPE struct option_dialog
53#include "speclist.h"
54#define option_dialogs_iterate(pdialog) \
55 TYPED_LIST_ITERATE(struct option_dialog, option_dialogs, pdialog)
56#define option_dialogs_iterate_end LIST_ITERATE_END
57
58/* All option dialog are set on this list. */
60
61enum {
68};
69
71
72
73/* Option dialog main functions. */
74static struct option_dialog *
76static struct option_dialog *
77option_dialog_new(const char *name, const struct option_set *poptset);
78static void option_dialog_destroy(struct option_dialog *pdialog);
79
80static void option_dialog_reorder_notebook(struct option_dialog *pdialog);
81static inline void option_dialog_foreach(struct option_dialog *pdialog,
82 void (*option_action)
83 (struct option *));
84
85/* Option dialog option-specific functions. */
86static void option_dialog_option_add(struct option_dialog *pdialog,
87 struct option *poption,
88 bool reorder_notebook);
89static void option_dialog_option_remove(struct option_dialog *pdialog,
90 struct option *poption);
91
93static void option_dialog_option_reset(struct option *poption);
94static void option_dialog_option_apply(struct option *poption);
95
96
97/************************************************************************/
102{
103 struct option_dialog *pdialog = (struct option_dialog *) data;
104
105 switch (response_id) {
106 case RESPONSE_CANCEL:
108 break;
109 case RESPONSE_OK:
112 break;
113 case RESPONSE_APPLY:
115 break;
116 case RESPONSE_RESET:
118 break;
119 case RESPONSE_REFRESH:
121 break;
122 case RESPONSE_SAVE:
125 break;
126 }
127}
128
129/************************************************************************/
133{
134 struct option_dialog *pdialog = (struct option_dialog *) data;
135
136 /* Save size of the dialog. */
140
141 if (NULL != pdialog->shell) {
142 /* Mark as destroyed, see also option_dialog_destroy(). */
143 pdialog->shell = NULL;
144 option_dialog_destroy(pdialog);
145 }
146}
147
148/************************************************************************/
152 gpointer data)
153{
154 struct option *poption = (struct option *)data;
156
157 if (NULL != pdialog) {
159 }
160
163}
164
165/************************************************************************/
169 gpointer data)
170{
171 struct option *poption = (struct option *) data;
173
174 if (NULL != pdialog) {
176 }
177
180}
181
182/************************************************************************/
186 gpointer data)
187{
188 struct option *poption = (struct option *) data;
190
191 if (NULL != pdialog) {
193 }
194
197}
198
199/************************************************************************/
203 int n_press,
204 double x, double y,
205 gpointer data)
206{
207 struct option *poption = (struct option *) data;
210 GMenu *menu;
211 GActionGroup *group;
212 GSimpleAction *act;
213 GdkRectangle rect = { .x = x, .y = y, .width = 1, .height = 1};
214
216 return FALSE;
217 }
218
220
221 menu = g_menu_new();
222
223 act = g_simple_action_new("refresh", NULL);
226 menu_item_append_unref(menu, g_menu_item_new(_("Refresh this option"),
227 "win.refresh"));
228
229 act = g_simple_action_new("unit_reset", NULL);
232 menu_item_append_unref(menu, g_menu_item_new(_("Reset this option"),
233 "win.unit_reset"));
234
235 act = g_simple_action_new("units_apply", NULL);
239 g_menu_item_new(_("Apply the changes for this option"),
240 "win.units_apply"));
241
245
248
250
251 return TRUE;
252}
253
254/************************************************************************/
257static struct option_dialog *
259{
260 if (NULL != option_dialogs) {
261 option_dialogs_iterate(pdialog) {
262 if (pdialog->poptset == poptset) {
263 return pdialog;
264 }
266 }
267 return NULL;
268}
269
270/************************************************************************/
274{
275 GdkRGBA *color = (GdkRGBA *) data;
276
277 if (NULL != color) {
279 }
280}
281
282/************************************************************************/
286 const GdkRGBA *new_color)
287{
288 GdkRGBA *current_color = g_object_get_data(G_OBJECT(button), "color");
289 GtkWidget *child;
290
291 if (NULL == new_color) {
292 if (NULL != current_color) {
293 g_object_set_data(G_OBJECT(button), "color", NULL);
294 gtk_button_set_child(button, NULL);
295 }
296 } else {
298
299 /* Apply the new color. */
300 if (NULL != current_color) {
301 /* We already have a GdkRGBA pointer. */
303 } else {
304 /* We need to make a GdkRGBA pointer. */
308 }
309 gtk_button_set_child(button, NULL);
310
311 /* Update the button. */
312 {
314 CAIRO_FORMAT_RGB24, 16, 16);
315 cairo_t *cr = cairo_create(surface);
316
318 cairo_paint(cr);
319 cairo_destroy(cr);
320 pixbuf = gdk_pixbuf_get_from_surface(surface, 0, 0, 16, 16);
321 cairo_surface_destroy(surface);
322 }
323
325 gtk_button_set_child(GTK_BUTTON(button), child);
328 }
329}
330
331/************************************************************************/
335 gint res, gpointer data)
336{
337 if (res == GTK_RESPONSE_REJECT) {
338 /* Clears the current color. */
340 } else if (res == GTK_RESPONSE_OK) {
341 /* Apply the new color. */
343 GTK_COLOR_CHOOSER(g_object_get_data(G_OBJECT(dialog), "chooser"));
345
348 }
349
351}
352
353/************************************************************************/
357{
358 GtkWidget *dialog, *chooser;
359 GdkRGBA *current_color = g_object_get_data(G_OBJECT(button), "color");
360
361 dialog = gtk_dialog_new_with_buttons(_("Select a color"), NULL,
363 _("_Cancel"), GTK_RESPONSE_CANCEL,
364 _("C_lear"), GTK_RESPONSE_REJECT,
365 _("_OK"), GTK_RESPONSE_OK, NULL);
366 setup_dialog(dialog, toplevel);
367 g_signal_connect(dialog, "response",
369
371 g_object_set_data(G_OBJECT(dialog), "chooser", chooser);
373 chooser, NULL);
374 if (current_color != NULL) {
376 }
377
379}
380
381/************************************************************************/
384static struct option_dialog *
385option_dialog_new(const char *name, const struct option_set *poptset)
386{
387 struct option_dialog *pdialog;
389
390 /* Create the dialog structure. */
391 pdialog = fc_malloc(sizeof(*pdialog));
392 pdialog->poptset = poptset;
394 _("_Cancel"), RESPONSE_CANCEL,
395 _("_Save"), RESPONSE_SAVE,
396 _("_Refresh"), RESPONSE_REFRESH,
397 _("Reset"), RESPONSE_RESET,
398 _("_Apply"), RESPONSE_APPLY,
399 _("_OK"), RESPONSE_OK, NULL);
400 pdialog->notebook = gtk_notebook_new();
401 pdialog->vboxes = fc_calloc(CATEGORY_NUM, sizeof(*pdialog->vboxes));
403 sizeof(*pdialog->box_children));
404
405 /* Append to the option dialog list. */
406 if (NULL == option_dialogs) {
408 }
410
411 /* Shell */
412 setup_dialog(pdialog->shell, toplevel);
416 g_signal_connect(pdialog->shell, "response",
418 g_signal_connect(pdialog->shell, "destroy",
420
422 pdialog->notebook, NULL);
423
424 /* Add the options. */
428
430
431 /* Show the widgets. */
433
434 return pdialog;
435}
436
437/************************************************************************/
440static void option_dialog_destroy(struct option_dialog *pdialog)
441{
442 GtkWidget *shell = pdialog->shell;
443
444 if (NULL != option_dialogs) {
446 }
447
448 options_iterate(pdialog->poptset, poption) {
451
452 if (NULL != shell) {
453 /* Maybe already destroyed, see also option_dialog_destroy_callback(). */
454 pdialog->shell = NULL;
456 }
457
458 free(pdialog->vboxes);
459 free(pdialog->box_children);
460 free(pdialog);
461}
462
463/************************************************************************/
466static int option_dialog_pages_sort_func(const void *w1, const void *w2)
467{
468 GObject *obj1 = G_OBJECT(*(GtkWidget **) w1);
469 GObject *obj2 = G_OBJECT(*(GtkWidget **) w2);
470
471 return (GPOINTER_TO_INT(g_object_get_data(obj1, "category"))
472 - GPOINTER_TO_INT(g_object_get_data(obj2, "category")));
473}
474
475/************************************************************************/
479{
482
483 if (0 < pages_num) {
484 GtkWidget *pages[pages_num];
485 int i;
486
487 for (i = 0; i < pages_num; i++) {
489 }
490 qsort(pages, pages_num, sizeof(*pages), option_dialog_pages_sort_func);
491 for (i = 0; i < pages_num; i++) {
493 }
494 }
495}
496
497/************************************************************************/
500static inline void option_dialog_foreach(struct option_dialog *pdialog,
501 void (*option_action)
502 (struct option *))
503{
504 fc_assert_ret(NULL != pdialog);
505
506 options_iterate(pdialog->poptset, poption) {
509}
510
511/************************************************************************/
514static void option_dialog_option_add(struct option_dialog *pdialog,
515 struct option *poption,
516 bool reorder_notebook)
517{
518 const int category = option_category(poption);
519 GtkWidget *main_hbox, *label, *w = NULL;
520 int main_col = 0;
523
525
526 /* Add category if needed. */
527 if (NULL == pdialog->vboxes[category]) {
528 GtkWidget *sw;
529
535 g_object_set_data(G_OBJECT(sw), "category", GINT_TO_POINTER(category));
539
540 if (reorder_notebook) {
542 }
543
544 pdialog->vboxes[category] = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
545 gtk_widget_set_margin_bottom(pdialog->vboxes[category], 8);
546 gtk_widget_set_margin_end(pdialog->vboxes[category], 8);
547 gtk_widget_set_margin_start(pdialog->vboxes[category], 8);
548 gtk_widget_set_margin_top(pdialog->vboxes[category], 8);
549 gtk_widget_set_hexpand(pdialog->vboxes[category], TRUE);
551 pdialog->vboxes[category]);
552
554 }
555 pdialog->box_children[category]++;
556
563 gtk_grid_attach(GTK_GRID(main_hbox), label, main_col++, 0, 1, 1);
568 g_signal_connect(controller, "pressed",
571 gtk_box_append(GTK_BOX(pdialog->vboxes[category]), main_hbox);
572
573 switch (option_type(poption)) {
574 case OT_BOOLEAN:
576 break;
577
578 case OT_INTEGER:
579 {
580 int min = option_int_min(poption), max = option_int_max(poption);
581
582 w = gtk_spin_button_new_with_range(min, max, MAX((max - min) / 50, 1));
583 }
584 break;
585
586 case OT_STRING:
587 {
588 const struct strvec *values = option_str_values(poption);
589
590 if (NULL != values) {
592 strvec_iterate(values, value) {
595 } else {
596 w = gtk_entry_new();
597 }
598 }
599 break;
600
601 case OT_ENUM:
602 {
603 int i;
604 const char *str;
605 GtkListStore *model;
606 GtkCellRenderer *renderer;
608
609 /* 0: enum index, 1: translated enum name. */
612 g_object_unref(model);
613
614 renderer = gtk_cell_renderer_text_new();
617 "text", 1, NULL);
618 for (i = 0; (str = option_enum_int_to_str(poption, i)); i++) {
620 gtk_list_store_set(model, &iter, 0, i, 1, _(str), -1);
621 }
622 }
623 break;
624
625 case OT_BITWISE:
626 {
627 GList *list = NULL;
628 GtkWidget *grid, *check;
629 const struct strvec *values = option_bitwise_values(poption);
630 int i;
631
632 w = gtk_frame_new(NULL);
633 grid = gtk_grid_new();
637 for (i = 0; i < strvec_size(values); i++) {
639 gtk_grid_attach(GTK_GRID(grid), check, 0, i, 1, 1);
640 label = gtk_label_new(_(strvec_get(values, i)));
641 gtk_grid_attach(GTK_GRID(grid), label, 1, i, 1, 1);
643 }
644 g_object_set_data_full(G_OBJECT(w), "check_buttons", list,
646 }
647 break;
648
649 case OT_FONT:
651 g_object_set(G_OBJECT(w), "use-font", TRUE, NULL);
652 break;
653
654 case OT_COLOR:
655 {
656 GtkWidget *button;
657 int grid_col = 0;
658
659 w = gtk_grid_new();
662
663 /* Foreground color selector button. */
664 button = gtk_button_new();
665 gtk_grid_attach(GTK_GRID(w), button, grid_col++, 0, 1, 1);
667 _("Select the text color"));
668 g_object_set_data(G_OBJECT(w), "fg_button", button);
669 g_signal_connect(button, "clicked",
671
672 /* Background color selector button. */
673 button = gtk_button_new();
674 gtk_grid_attach(GTK_GRID(w), button, grid_col++, 0, 1, 1);
676 _("Select the background color"));
677 g_object_set_data(G_OBJECT(w), "bg_button", button);
678 g_signal_connect(button, "clicked",
680 }
681 break;
682
683 case OT_VIDEO_MODE:
684 log_error("Option type %s (%d) not supported yet.",
687 break;
688 }
689
691 if (NULL == w) {
692 log_error("Failed to create a widget for option %d \"%s\".",
694 } else {
695 g_object_set_data(G_OBJECT(w), "main_widget", main_hbox);
696 g_object_set_data(G_OBJECT(w), "parent_of_main", pdialog->vboxes[category]);
700 }
701
703
704 /* Set as current value. */
706}
707
708/************************************************************************/
711static void option_dialog_option_remove(struct option_dialog *pdialog,
712 struct option *poption)
713{
715
716 if (NULL != object) {
717 const int category = option_category(poption);
718
720 gtk_box_remove(GTK_BOX(g_object_get_data(object, "parent_of_main")),
721 GTK_WIDGET(g_object_get_data(object, "main_widget")));
722
723 /* Remove category if needed. */
724 if (0 == --pdialog->box_children[category]) {
726 pdialog->vboxes[category] = NULL;
727 }
728 }
729}
730
731/************************************************************************/
735 bool value)
736{
739 value);
740}
741
742/************************************************************************/
745static inline void option_dialog_option_int_set(struct option *poption,
746 int value)
747{
749 value);
750}
751
752/************************************************************************/
755static inline void option_dialog_option_str_set(struct option *poption,
756 const char *string)
757{
759
762
764 } else {
766 }
767}
768
769/************************************************************************/
773 int value)
774{
778 int i;
779
780 if (gtk_tree_model_get_iter_first(model, &iter)) {
781 do {
782 gtk_tree_model_get(model, &iter, 0, &i, -1);
783 if (i == value) {
785 return;
786 }
787 } while (gtk_tree_model_iter_next(model, &iter));
788 }
789
790 log_error("Didn't find the value %d for option \"%s\" (nb %d).",
792}
793
794/************************************************************************/
798 unsigned value)
799{
801 GList *iter = g_object_get_data(data, "check_buttons");
802 int bit;
803
804 for (bit = 0; NULL != iter; iter = g_list_next(iter), bit++) {
806 value & (1 << bit));
807 }
808}
809
810/************************************************************************/
814 const char *font)
815{
818}
819
820/************************************************************************/
824 struct ft_color color)
825{
828
829 /* Update the foreground button. */
830 if (NULL != color.foreground
831 && '\0' != color.foreground[0]
832 && gdk_rgba_parse(&gdk_color, color.foreground)) {
834 "fg_button"),
835 &gdk_color);
836 } else {
838 "fg_button"), NULL);
839 }
840
841 /* Update the background button. */
842 if (NULL != color.background
843 && '\0' != color.background[0]
844 && gdk_rgba_parse(&gdk_color, color.background)) {
846 "bg_button"),
847 &gdk_color);
848 } else {
850 "bg_button"), NULL);
851 }
852}
853
854/************************************************************************/
891
892/************************************************************************/
926
927/************************************************************************/
931{
933
934 switch (option_type(poption)) {
935 case OT_BOOLEAN:
937 (GTK_CHECK_BUTTON(w)));
938 break;
939
940 case OT_INTEGER:
942 (GTK_SPIN_BUTTON(w)));
943 break;
944
945 case OT_STRING:
949 } else {
952 }
953 break;
954
955 case OT_ENUM:
956 {
958 int value;
959
961 break;
962 }
963
965 &iter, 0, &value, -1);
967 }
968 break;
969
970 case OT_BITWISE:
971 {
972 GList *iter = g_object_get_data(G_OBJECT(w), "check_buttons");
973 unsigned value = 0;
974 int bit;
975
976 for (bit = 0; NULL != iter; iter = g_list_next(iter), bit++) {
978 value |= 1 << bit;
979 }
980 }
982 }
983 break;
984
985 case OT_FONT:
987 (GTK_FONT_CHOOSER(w)));
988 break;
989
990 case OT_COLOR:
991 {
993 GObject *button;
994 GdkRGBA *color;
995
996 /* Get foreground color. */
997 button = g_object_get_data(G_OBJECT(w), "fg_button");
998 color = g_object_get_data(button, "color");
1000
1001 /* Get background color. */
1002 button = g_object_get_data(G_OBJECT(w), "bg_button");
1003 color = g_object_get_data(button, "color");
1005
1010 }
1011 break;
1012
1013 case OT_VIDEO_MODE:
1014 log_error("Option type %s (%d) not supported yet.",
1017 break;
1018 }
1019}
1020
1021/************************************************************************/
1024void option_dialog_popup(const char *name, const struct option_set *poptset)
1025{
1026 struct option_dialog *pdialog = option_dialog_get(poptset);
1027
1028 if (NULL != pdialog) {
1030 } else {
1032 }
1033}
1034
1035/************************************************************************/
1039{
1040 struct option_dialog *pdialog = option_dialog_get(poptset);
1041
1042 if (NULL != pdialog) {
1043 option_dialog_destroy(pdialog);
1044 }
1045}
1046
1047/************************************************************************/
1052{
1054 if (strcmp(option_name(poption), "aifill") == 0) {
1056 } else if (strcmp(option_name(poption), "nationset") == 0) {
1058 }
1059 }
1060}
1061
1062/************************************************************************/
1066{
1068
1069 if (NULL != pdialog) {
1071 }
1072
1074}
1075
1076/************************************************************************/
1080{
1082
1083 if (NULL != pdialog) {
1085 }
1086
1088}
1089
1090/************************************************************************/
1094{
1096
1097 if (NULL != pdialog) {
1099 }
1100}
#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:130
static void color_selector_response_callback(GtkDialog *dialog, gint res, gpointer data)
Definition optiondlg.c:310
static int opt_dlog_height
Definition optiondlg.c:39
static struct option_dialog * option_dialog_get(const struct option_set *poptset)
Definition optiondlg.c:232
void option_gui_remove(struct option *poption)
Definition optiondlg.c:1054
static void option_dialog_option_refresh(struct option *poption)
Definition optiondlg.c:819
static int opt_dlog_width
Definition optiondlg.c:39
void option_dialog_popdown(const struct option_set *poptset)
Definition optiondlg.c:999
static void option_dialog_option_color_set(struct option *poption, struct ft_color color)
Definition optiondlg.c:785
static void option_color_set_button_color(GtkButton *button, const GdkRGBA *new_color)
Definition optiondlg.c:259
static void option_dialog_option_add(struct option_dialog *pdialog, struct option *poption, bool reorder_notebook)
Definition optiondlg.c:492
#define option_dialogs_iterate_end
Definition optiondlg.c:56
static void option_dialog_option_bitwise_set(struct option *poption, unsigned value)
Definition optiondlg.c:759
static void option_dialog_destroy(struct option_dialog *pdialog)
Definition optiondlg.c:418
static void option_dialog_option_bool_set(struct option *poption, bool value)
Definition optiondlg.c:699
static void option_dialog_option_remove(struct option_dialog *pdialog, struct option *poption)
Definition optiondlg.c:677
void option_gui_add(struct option *poption)
Definition optiondlg.c:1040
static void option_color_select_callback(GtkButton *button, gpointer data)
Definition optiondlg.c:332
static void option_dialog_option_int_set(struct option *poption, int value)
Definition optiondlg.c:710
static void option_dialog_reponse_callback(GtkDialog *dialog, gint response_id, gpointer data)
Definition optiondlg.c:98
#define option_dialogs_iterate(pdialog)
Definition optiondlg.c:54
static void option_gui_update_extra(struct option *poption)
Definition optiondlg.c:1012
static void option_apply_callback(GtkMenuItem *menuitem, gpointer data)
Definition optiondlg.c:180
static void option_color_destroy_notify(gpointer data)
Definition optiondlg.c:247
@ RESPONSE_SAVE
Definition optiondlg.c:67
@ RESPONSE_APPLY
Definition optiondlg.c:64
@ RESPONSE_CANCEL
Definition optiondlg.c:62
@ RESPONSE_OK
Definition optiondlg.c:63
@ RESPONSE_RESET
Definition optiondlg.c:65
@ RESPONSE_REFRESH
Definition optiondlg.c:66
static void option_dialog_option_font_set(struct option *poption, const char *font)
Definition optiondlg.c:775
void option_gui_update(struct option *poption)
Definition optiondlg.c:1026
static int option_dialog_pages_sort_func(const void *w1, const void *w2)
Definition optiondlg.c:444
void option_dialog_popup(const char *name, const struct option_set *poptset)
Definition optiondlg.c:985
static void option_dialog_reorder_notebook(struct option_dialog *pdialog)
Definition optiondlg.c:456
static void option_dialog_option_apply(struct option *poption)
Definition optiondlg.c:892
static gboolean option_button_press_callback(GtkWidget *widget, GdkEventButton *event, gpointer data)
Definition optiondlg.c:193
static void option_dialog_option_reset(struct option *poption)
Definition optiondlg.c:857
static void option_reset_callback(GtkMenuItem *menuitem, gpointer data)
Definition optiondlg.c:167
static void option_dialog_foreach(struct option_dialog *pdialog, void(*option_action)(struct option *))
Definition optiondlg.c:478
static void option_dialog_option_str_set(struct option *poption, const char *string)
Definition optiondlg.c:720
static struct option_dialog_list * option_dialogs
Definition optiondlg.c:59
static void option_dialog_option_enum_set(struct option *poption, int value)
Definition optiondlg.c:734
static void option_refresh_callback(GtkMenuItem *menuitem, gpointer data)
Definition optiondlg.c:154
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:70
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:919
unsigned option_bitwise_def(const struct option *poption)
Definition options.c:1089
int option_int_min(const struct option *poption)
Definition options.c:860
bool option_bool_def(const struct option *poption)
Definition options.c:812
const char * option_font_def(const struct option *poption)
Definition options.c:1156
const struct option_set * server_optset
Definition options.c:4020
const char * option_description(const struct option *poption)
Definition options.c:642
const char * option_help_text(const struct option *poption)
Definition options.c:652
struct ft_color option_color_get(const struct option *poption)
Definition options.c:1194
int option_enum_get_int(const struct option *poption)
Definition options.c:984
int option_number(const struct option *poption)
Definition options.c:622
int option_category(const struct option *poption)
Definition options.c:672
bool option_str_set(struct option *poption, const char *str)
Definition options.c:930
const char * option_name(const struct option *poption)
Definition options.c:632
int option_int_get(const struct option *poption)
Definition options.c:838
bool option_color_set(struct option *poption, struct ft_color color)
Definition options.c:1217
bool option_bool_set(struct option *poption, bool val)
Definition options.c:823
bool option_is_changeable(const struct option *poption)
Definition options.c:693
void option_set_gui_data(struct option *poption, void *data)
Definition options.c:771
const char * option_str_get(const struct option *poption)
Definition options.c:897
void * option_get_gui_data(const struct option *poption)
Definition options.c:781
bool option_enum_set_int(struct option *poption, int val)
Definition options.c:1044
bool option_bool_get(const struct option *poption)
Definition options.c:801
int optset_category_number(const struct option_set *poptset)
Definition options.c:461
enum option_type option_type(const struct option *poption)
Definition options.c:662
const char * option_enum_int_to_str(const struct option *poption, int val)
Definition options.c:969
const struct option_set * option_optset(const struct option *poption)
Definition options.c:612
const char * option_str_def(const struct option *poption)
Definition options.c:908
int option_int_max(const struct option *poption)
Definition options.c:871
bool option_font_set(struct option *poption, const char *font)
Definition options.c:1178
void queue_options_save(option_save_log_callback log_cb)
Definition options.c:6103
const struct strvec * option_bitwise_values(const struct option *poption)
Definition options.c:1117
bool option_bitwise_set(struct option *poption, unsigned val)
Definition options.c:1128
const char * option_font_get(const struct option *poption)
Definition options.c:1145
struct ft_color option_color_def(const struct option *poption)
Definition options.c:1205
unsigned option_bitwise_get(const struct option *poption)
Definition options.c:1078
int option_enum_def_int(const struct option *poption)
Definition options.c:1008
bool option_int_set(struct option *poption, int val)
Definition options.c:882
const char * option_category_name(const struct option *poption)
Definition options.c:682
int option_int_def(const struct option *poption)
Definition options.c:849
#define options_iterate(poptset, poption)
Definition options.h:553
#define options_iterate_end
Definition options.h:558
#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:47
GtkWidget ** vboxes
Definition optiondlg.c:46
GtkWidget * shell
Definition optiondlg.c:44
const struct option_set * poptset
Definition optiondlg.c:43
GtkWidget * notebook
Definition optiondlg.c:45
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47