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-3.22 */
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. */
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
69
70/* Option dialog main functions. */
71static struct option_dialog *
73static struct option_dialog *
74option_dialog_new(const char *name, const struct option_set *poptset);
75static void option_dialog_destroy(struct option_dialog *pdialog);
76
77static void option_dialog_reorder_notebook(struct option_dialog *pdialog);
78static inline void option_dialog_foreach(struct option_dialog *pdialog,
79 void (*option_action)
80 (struct option *));
81
82/* Option dialog option-specific functions. */
83static void option_dialog_option_add(struct option_dialog *pdialog,
84 struct option *poption,
85 bool reorder_notebook);
86static void option_dialog_option_remove(struct option_dialog *pdialog,
87 struct option *poption);
88
90static void option_dialog_option_reset(struct option *poption);
91static void option_dialog_option_apply(struct option *poption);
92
93
94/************************************************************************/
99{
100 struct option_dialog *pdialog = (struct option_dialog *) data;
101
102 switch (response_id) {
103 case RESPONSE_CANCEL:
105 break;
106 case RESPONSE_OK:
109 break;
110 case RESPONSE_APPLY:
112 break;
113 case RESPONSE_RESET:
115 break;
116 case RESPONSE_REFRESH:
118 break;
119 case RESPONSE_SAVE:
122 break;
123 }
124}
125
126/************************************************************************/
130{
131 struct option_dialog *pdialog = (struct option_dialog *) data;
134 int baseline;
135
136 /* Save size of the dialog. */
142
143 if (NULL != pdialog->shell) {
144 /* Mark as destroyed, see also option_dialog_destroy(). */
145 pdialog->shell = NULL;
146 option_dialog_destroy(pdialog);
147 }
148}
149
150/************************************************************************/
154{
155 struct option *poption = (struct option *) data;
157
158 if (NULL != pdialog) {
160 }
161}
162
163/************************************************************************/
167{
168 struct option *poption = (struct option *) data;
170
171 if (NULL != pdialog) {
173 }
174}
175
176/************************************************************************/
180{
181 struct option *poption = (struct option *) data;
183
184 if (NULL != pdialog) {
186 }
187}
188
189/************************************************************************/
194 gpointer data)
195{
196 struct option *poption = (struct option *) data;
197 GtkWidget *menu, *item;
198
199 if (3 != event->button || !option_is_changeable(poption)) {
200 /* Only right button please! */
201 return FALSE;
202 }
203
204 menu = gtk_menu_new();
205
206 item = gtk_menu_item_new_with_label(_("Refresh this option"));
208 g_signal_connect(item, "activate",
210
211 item = gtk_menu_item_new_with_label(_("Reset this option"));
213 g_signal_connect(item, "activate",
215
216 item = gtk_menu_item_new_with_label(_("Apply the changes for this option"));
218 g_signal_connect(item, "activate",
220
223
224 return TRUE;
225}
226
227/************************************************************************/
230static struct option_dialog *
232{
233 if (NULL != option_dialogs) {
234 option_dialogs_iterate(pdialog) {
235 if (pdialog->poptset == poptset) {
236 return pdialog;
237 }
239 }
240 return NULL;
241}
242
243/************************************************************************/
247{
248 GdkRGBA *color = (GdkRGBA *) data;
249
250 if (NULL != color) {
252 }
253}
254
255/************************************************************************/
259 const GdkRGBA *new_color)
260{
261 GdkRGBA *current_color = g_object_get_data(G_OBJECT(button), "color");
262 GtkWidget *child;
263
264 if (NULL == new_color) {
265 if (NULL != current_color) {
266 g_object_set_data(G_OBJECT(button), "color", NULL);
267 if ((child = gtk_bin_get_child(GTK_BIN(button)))) {
268 gtk_widget_destroy(child);
269 }
270 }
271 } else {
273
274 /* Apply the new color. */
275 if (NULL != current_color) {
276 /* We already have a GdkRGBA pointer. */
278 } else {
279 /* We need to make a GdkRGBA pointer. */
283 }
284 if ((child = gtk_bin_get_child(GTK_BIN(button)))) {
285 gtk_widget_destroy(child);
286 }
287
288 /* Update the button. */
289 {
291 CAIRO_FORMAT_RGB24, 16, 16);
292 cairo_t *cr = cairo_create(surface);
294 cairo_paint(cr);
295 cairo_destroy(cr);
296 pixbuf = gdk_pixbuf_get_from_surface(surface, 0, 0, 16, 16);
297 cairo_surface_destroy(surface);
298 }
300 gtk_container_add(GTK_CONTAINER(button), child);
301 gtk_widget_show(child);
303 }
304}
305
306/************************************************************************/
310 gint res, gpointer data)
311{
312 if (res == GTK_RESPONSE_REJECT) {
313 /* Clears the current color. */
315 } else if (res == GTK_RESPONSE_OK) {
316 /* Apply the new color. */
318 GTK_COLOR_CHOOSER(g_object_get_data(G_OBJECT(dialog), "chooser"));
320
323 }
324
326}
327
328/************************************************************************/
332{
333 GtkWidget *dialog, *chooser;
334 GdkRGBA *current_color = g_object_get_data(G_OBJECT(button), "color");
335
336 dialog = gtk_dialog_new_with_buttons(_("Select a color"), NULL,
338 _("_Cancel"), GTK_RESPONSE_CANCEL,
339 _("C_lear"), GTK_RESPONSE_REJECT,
340 _("_OK"), GTK_RESPONSE_OK, NULL);
341 setup_dialog(dialog, toplevel);
342 g_signal_connect(dialog, "response",
344
346 g_object_set_data(G_OBJECT(dialog), "chooser", chooser);
348 FALSE, FALSE, 0);
349 if (current_color) {
351 }
352
353 gtk_widget_show_all(dialog);
354}
355
356
357/************************************************************************/
360static struct option_dialog *
361option_dialog_new(const char *name, const struct option_set *poptset)
362{
363 struct option_dialog *pdialog;
365
366 /* Create the dialog structure. */
367 pdialog = fc_malloc(sizeof(*pdialog));
368 pdialog->poptset = poptset;
370 _("_Cancel"), RESPONSE_CANCEL,
371 _("_Save"), RESPONSE_SAVE,
372 _("_Refresh"), RESPONSE_REFRESH,
373 _("Reset"), RESPONSE_RESET,
374 _("_Apply"), RESPONSE_APPLY,
375 _("_OK"), RESPONSE_OK, NULL);
376 pdialog->notebook = gtk_notebook_new();
377 pdialog->vboxes = fc_calloc(CATEGORY_NUM, sizeof(*pdialog->vboxes));
379 sizeof(*pdialog->box_children));
380
381 /* Append to the option dialog list. */
382 if (NULL == option_dialogs) {
384 }
386
387 /* Shell */
388 setup_dialog(pdialog->shell, toplevel);
393 g_signal_connect(pdialog->shell, "response",
395 g_signal_connect(pdialog->shell, "destroy",
397
399 pdialog->notebook, TRUE, TRUE, 0);
400
401 /* Add the options. */
405
407
408 /* Show the widgets. */
409 gtk_widget_show_all(pdialog->shell);
410
411 return pdialog;
412}
413
414/************************************************************************/
417static void option_dialog_destroy(struct option_dialog *pdialog)
418{
419 GtkWidget *shell = pdialog->shell;
420
421 if (NULL != option_dialogs) {
423 }
424
425 options_iterate(pdialog->poptset, poption) {
428
429 if (NULL != shell) {
430 /* Maybe already destroyed, see also option_dialog_destroy_callback(). */
431 pdialog->shell = NULL;
433 }
434
435 free(pdialog->vboxes);
436 free(pdialog->box_children);
437 free(pdialog);
438}
439
440/************************************************************************/
443static int option_dialog_pages_sort_func(const void *w1, const void *w2)
444{
445 GObject *obj1 = G_OBJECT(*(GtkWidget **) w1);
446 GObject *obj2 = G_OBJECT(*(GtkWidget **) w2);
447
448 return (GPOINTER_TO_INT(g_object_get_data(obj1, "category"))
449 - GPOINTER_TO_INT(g_object_get_data(obj2, "category")));
450}
451
452/************************************************************************/
456{
459
460 if (0 < pages_num) {
461 GtkWidget *pages[pages_num];
462 int i;
463
464 for (i = 0; i < pages_num; i++) {
466 }
467 qsort(pages, pages_num, sizeof(*pages), option_dialog_pages_sort_func);
468 for (i = 0; i < pages_num; i++) {
470 }
471 }
472}
473
474/************************************************************************/
477static inline void option_dialog_foreach(struct option_dialog *pdialog,
478 void (*option_action)
479 (struct option *))
480{
481 fc_assert_ret(NULL != pdialog);
482
483 options_iterate(pdialog->poptset, poption) {
486}
487
488/************************************************************************/
491static void option_dialog_option_add(struct option_dialog *pdialog,
492 struct option *poption,
493 bool reorder_notebook)
494{
495 const int category = option_category(poption);
496 GtkWidget *main_hbox, *label, *ebox, *w = NULL;
497
499
500 /* Add category if needed. */
501 if (NULL == pdialog->vboxes[category]) {
502 GtkWidget *sw;
503
508 g_object_set_data(G_OBJECT(sw), "category", GINT_TO_POINTER(category));
512
513 if (reorder_notebook) {
515 }
516
517 pdialog->vboxes[category] = gtk_grid_new();
520 g_object_set(pdialog->vboxes[category], "margin", 8, NULL);
521 gtk_widget_set_hexpand(pdialog->vboxes[category], TRUE);
522 gtk_container_add(GTK_CONTAINER(sw), pdialog->vboxes[category]);
523
525 }
526 pdialog->box_children[category]++;
527
528 ebox = gtk_event_box_new();
530 gtk_container_add(GTK_CONTAINER(pdialog->vboxes[category]), ebox);
531 g_signal_connect(ebox, "button_press_event",
533
536 g_object_set(label, "margin", 2, NULL);
539
540 switch (option_type(poption)) {
541 case OT_BOOLEAN:
543 break;
544
545 case OT_INTEGER:
546 {
547 int min = option_int_min(poption), max = option_int_max(poption);
548
549 w = gtk_spin_button_new_with_range(min, max, MAX((max - min) / 50, 1));
550 }
551 break;
552
553 case OT_STRING:
554 {
555 const struct strvec *values = option_str_values(poption);
556
557 if (NULL != values) {
559 strvec_iterate(values, value) {
562 } else {
563 w = gtk_entry_new();
564 }
565 }
566 break;
567
568 case OT_ENUM:
569 {
570 int i;
571 const char *str;
572 GtkListStore *model;
573 GtkCellRenderer *renderer;
575
576 /* 0: enum index, 1: translated enum name. */
579 g_object_unref(model);
580
581 renderer = gtk_cell_renderer_text_new();
584 "text", 1, NULL);
585 for (i = 0; (str = option_enum_int_to_str(poption, i)); i++) {
587 gtk_list_store_set(model, &iter, 0, i, 1, _(str), -1);
588 }
589 }
590 break;
591
592 case OT_BITWISE:
593 {
594 GList *list = NULL;
595 GtkWidget *grid, *check;
596 const struct strvec *values = option_bitwise_values(poption);
597 int i;
598
599 w = gtk_frame_new(NULL);
600 grid = gtk_grid_new();
604 for (i = 0; i < strvec_size(values); i++) {
606 gtk_grid_attach(GTK_GRID(grid), check, 0, i, 1, 1);
607 label = gtk_label_new(_(strvec_get(values, i)));
608 gtk_grid_attach(GTK_GRID(grid), label, 1, i, 1, 1);
610 }
611 g_object_set_data_full(G_OBJECT(w), "check_buttons", list,
613 }
614 break;
615
616 case OT_FONT:
618 g_object_set(G_OBJECT(w), "use-font", TRUE, NULL);
619 break;
620
621 case OT_COLOR:
622 {
623 GtkWidget *button;
624
625 w = gtk_grid_new();
628
629 /* Foreground color selector button. */
630 button = gtk_button_new();
633 _("Select the text color"));
634 g_object_set_data(G_OBJECT(w), "fg_button", button);
635 g_signal_connect(button, "clicked",
637
638 /* Background color selector button. */
639 button = gtk_button_new();
642 _("Select the background color"));
643 g_object_set_data(G_OBJECT(w), "bg_button", button);
644 g_signal_connect(button, "clicked",
646 }
647 break;
648
649 case OT_VIDEO_MODE:
650 log_error("Option type %s (%d) not supported yet.",
653 break;
654 }
655
657 if (NULL == w) {
658 log_error("Failed to create a widget for option %d \"%s\".",
660 } else {
661 g_object_set_data(G_OBJECT(w), "main_widget", ebox);
665 }
666
668
669 /* Set as current value. */
671}
672
673/************************************************************************/
676static void option_dialog_option_remove(struct option_dialog *pdialog,
677 struct option *poption)
678{
680
681 if (NULL != object) {
682 const int category = option_category(poption);
683
685 gtk_widget_destroy(GTK_WIDGET(g_object_get_data(object, "main_widget")));
686
687 /* Remove category if needed. */
688 if (0 == --pdialog->box_children[category]) {
690 pdialog->vboxes[category] = NULL;
691 }
692 }
693}
694
695/************************************************************************/
699 bool value)
700{
703 value);
704}
705
706/************************************************************************/
709static inline void option_dialog_option_int_set(struct option *poption,
710 int value)
711{
713 value);
714}
715
716/************************************************************************/
719static inline void option_dialog_option_str_set(struct option *poption,
720 const char *string)
721{
724 (option_get_gui_data(poption)))), string);
725 } else {
727 }
728}
729
730/************************************************************************/
734 int value)
735{
739 int i;
740
741 if (gtk_tree_model_get_iter_first(model, &iter)) {
742 do {
743 gtk_tree_model_get(model, &iter, 0, &i, -1);
744 if (i == value) {
746 return;
747 }
748 } while (gtk_tree_model_iter_next(model, &iter));
749 }
750
751 log_error("Didn't find the value %d for option \"%s\" (nb %d).",
753}
754
755/************************************************************************/
759 unsigned value)
760{
762 GList *iter = g_object_get_data(data, "check_buttons");
763 int bit;
764
765 for (bit = 0; NULL != iter; iter = g_list_next(iter), bit++) {
767 value & (1 << bit));
768 }
769}
770
771/************************************************************************/
775 const char *font)
776{
779}
780
781/************************************************************************/
785 struct ft_color color)
786{
789
790 /* Update the foreground button. */
791 if (NULL != color.foreground
792 && '\0' != color.foreground[0]
793 && gdk_rgba_parse(&gdk_color, color.foreground)) {
795 "fg_button"),
796 &gdk_color);
797 } else {
799 "fg_button"), NULL);
800 }
801
802 /* Update the background button. */
803 if (NULL != color.background
804 && '\0' != color.background[0]
805 && gdk_rgba_parse(&gdk_color, color.background)) {
807 "bg_button"),
808 &gdk_color);
809 } else {
811 "bg_button"), NULL);
812 }
813}
814
815/************************************************************************/
852
853/************************************************************************/
887
888/************************************************************************/
892{
894
895 switch (option_type(poption)) {
896 case OT_BOOLEAN:
898 (GTK_TOGGLE_BUTTON(w)));
899 break;
900
901 case OT_INTEGER:
903 (GTK_SPIN_BUTTON(w)));
904 break;
905
906 case OT_STRING:
910 } else {
912 }
913 break;
914
915 case OT_ENUM:
916 {
918 int value;
919
921 break;
922 }
923
925 &iter, 0, &value, -1);
927 }
928 break;
929
930 case OT_BITWISE:
931 {
932 GList *iter = g_object_get_data(G_OBJECT(w), "check_buttons");
933 unsigned value = 0;
934 int bit;
935
936 for (bit = 0; NULL != iter; iter = g_list_next(iter), bit++) {
938 value |= 1 << bit;
939 }
940 }
942 }
943 break;
944
945 case OT_FONT:
947 (GTK_FONT_CHOOSER(w)));
948 break;
949
950 case OT_COLOR:
951 {
953 GObject *button;
954 GdkRGBA *color;
955
956 /* Get foreground color. */
957 button = g_object_get_data(G_OBJECT(w), "fg_button");
958 color = g_object_get_data(button, "color");
960
961 /* Get background color. */
962 button = g_object_get_data(G_OBJECT(w), "bg_button");
963 color = g_object_get_data(button, "color");
965
970 }
971 break;
972
973 case OT_VIDEO_MODE:
974 log_error("Option type %s (%d) not supported yet.",
977 break;
978 }
979}
980
981/************************************************************************/
984void option_dialog_popup(const char *name, const struct option_set *poptset)
985{
986 struct option_dialog *pdialog = option_dialog_get(poptset);
987
988 if (NULL != pdialog) {
990 } else {
992 }
993}
994
995/************************************************************************/
999{
1000 struct option_dialog *pdialog = option_dialog_get(poptset);
1001
1002 if (NULL != pdialog) {
1003 option_dialog_destroy(pdialog);
1004 }
1005}
1006
1007/************************************************************************/
1012{
1014 if (strcmp(option_name(poption), "aifill") == 0) {
1016 } else if (strcmp(option_name(poption), "nationset") == 0) {
1018 }
1019 }
1020}
1021
1022/************************************************************************/
1026{
1028
1029 if (NULL != pdialog) {
1031 }
1032
1034}
1035
1036/************************************************************************/
1040{
1042
1043 if (NULL != pdialog) {
1045 }
1046
1048}
1049
1050/************************************************************************/
1054{
1056
1057 if (NULL != pdialog) {
1059 }
1060}
#define str
Definition astring.c:76
static struct fc_sockaddr_list * list
Definition clinet.c:102
char * incite_cost
Definition comments.c:76
enum event_type event
Definition events.c:81
#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
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
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
Definition climisc.h:82
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