Freeciv-3.1
|
#include <stdlib.h>
#include <gtk/gtk.h>
#include "log.h"
#include "mem.h"
#include "string_vector.h"
#include "options.h"
#include "colors.h"
#include "dialogs.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "pages.h"
#include "optiondlg.h"
#include "speclist.h"
Go to the source code of this file.
Data Structures | |
struct | option_dialog |
Macros | |
#define | SPECLIST_TAG option_dialog |
#define | SPECLIST_TYPE struct option_dialog |
#define | option_dialogs_iterate(pdialog) TYPED_LIST_ITERATE(struct option_dialog, option_dialogs, pdialog) |
#define | option_dialogs_iterate_end LIST_ITERATE_END |
Enumerations | |
enum | { RESPONSE_CANCEL , RESPONSE_OK , RESPONSE_APPLY , RESPONSE_RESET , RESPONSE_REFRESH , RESPONSE_SAVE } |
Functions | |
static struct option_dialog * | option_dialog_get (const struct option_set *poptset) |
static struct option_dialog * | option_dialog_new (const char *name, const struct option_set *poptset) |
static void | option_dialog_destroy (struct option_dialog *pdialog) |
static void | option_dialog_reorder_notebook (struct option_dialog *pdialog) |
static void | option_dialog_foreach (struct option_dialog *pdialog, void(*option_action)(struct option *)) |
static void | option_dialog_option_add (struct option_dialog *pdialog, struct option *poption, bool reorder_notebook) |
static void | option_dialog_option_remove (struct option_dialog *pdialog, struct option *poption) |
static void | option_dialog_option_refresh (struct option *poption) |
static void | option_dialog_option_reset (struct option *poption) |
static void | option_dialog_option_apply (struct option *poption) |
static void | option_dialog_reponse_callback (GtkDialog *dialog, gint response_id, gpointer data) |
static void | option_dialog_destroy_callback (GtkWidget *object, gpointer data) |
static void | option_refresh_callback (GtkMenuItem *menuitem, gpointer data) |
static void | option_reset_callback (GtkMenuItem *menuitem, gpointer data) |
static void | option_apply_callback (GtkMenuItem *menuitem, gpointer data) |
static gboolean | option_button_press_callback (GtkWidget *widget, GdkEventButton *event, gpointer data) |
static void | option_color_destroy_notify (gpointer data) |
static void | option_color_set_button_color (GtkButton *button, const GdkRGBA *new_color) |
static void | color_selector_response_callback (GtkDialog *dialog, gint res, gpointer data) |
static void | option_color_select_callback (GtkButton *button, gpointer data) |
static int | option_dialog_pages_sort_func (const void *w1, const void *w2) |
static void | option_dialog_option_bool_set (struct option *poption, bool value) |
static void | option_dialog_option_int_set (struct option *poption, int value) |
static void | option_dialog_option_str_set (struct option *poption, const char *string) |
static void | option_dialog_option_enum_set (struct option *poption, int value) |
static void | option_dialog_option_bitwise_set (struct option *poption, unsigned value) |
static void | option_dialog_option_font_set (struct option *poption, const char *font) |
static void | option_dialog_option_color_set (struct option *poption, struct ft_color color) |
void | option_dialog_popup (const char *name, const struct option_set *poptset) |
void | option_dialog_popdown (const struct option_set *poptset) |
static void | option_gui_update_extra (struct option *poption) |
void | option_gui_update (struct option *poption) |
void | option_gui_add (struct option *poption) |
void | option_gui_remove (struct option *poption) |
Variables | |
static struct option_dialog_list * | option_dialogs = NULL |
#define option_dialogs_iterate | ( | pdialog | ) | TYPED_LIST_ITERATE(struct option_dialog, option_dialogs, pdialog) |
Definition at line 53 of file optiondlg.c.
#define option_dialogs_iterate_end LIST_ITERATE_END |
Definition at line 55 of file optiondlg.c.
#define SPECLIST_TAG option_dialog |
Definition at line 50 of file optiondlg.c.
#define SPECLIST_TYPE struct option_dialog |
Definition at line 51 of file optiondlg.c.
anonymous enum |
Enumerator | |
---|---|
RESPONSE_CANCEL | |
RESPONSE_OK | |
RESPONSE_APPLY | |
RESPONSE_RESET | |
RESPONSE_REFRESH | |
RESPONSE_SAVE |
Definition at line 60 of file optiondlg.c.
|
static |
"response" signal callback.
Definition at line 306 of file optiondlg.c.
Referenced by option_color_select_callback().
|
static |
Option apply requested from menu.
Definition at line 169 of file optiondlg.c.
Referenced by option_button_press_callback(), and option_button_press_callback().
|
static |
Called when a button is pressed on an option.
Definition at line 182 of file optiondlg.c.
Referenced by option_dialog_option_add().
|
static |
GDestroyNotify callback.
Definition at line 243 of file optiondlg.c.
Referenced by option_color_set_button_color().
|
static |
Called when the user press a color button.
Definition at line 328 of file optiondlg.c.
Referenced by option_dialog_option_add().
|
static |
Set the color of a button.
Definition at line 255 of file optiondlg.c.
Referenced by color_selector_response_callback(), and option_dialog_option_color_set().
|
static |
Destroys an option dialog.
Definition at line 412 of file optiondlg.c.
Referenced by option_dialog_destroy_callback(), option_dialog_popdown(), and popdown_optiondlg().
|
static |
Option dialog widget destroyed callback.
Definition at line 129 of file optiondlg.c.
Referenced by option_dialog_new().
|
inlinestatic |
Do an action for all options of the option dialog.
Definition at line 472 of file optiondlg.c.
Referenced by option_dialog_popup(), and option_dialog_reponse_callback().
|
static |
Returns the option dialog which fit the option set.
Definition at line 228 of file optiondlg.c.
Referenced by option_apply_callback(), option_apply_callback(), option_dialog_popdown(), option_dialog_popup(), option_gui_add(), option_gui_remove(), option_gui_update(), option_refresh_callback(), option_refresh_callback(), option_reset_callback(), and option_reset_callback().
|
static |
Creates a new option dialog.
Definition at line 358 of file optiondlg.c.
|
static |
Add an option to the option dialog.
Definition at line 486 of file optiondlg.c.
Referenced by option_dialog_new(), and option_gui_add().
|
static |
Apply the option change.
Definition at line 886 of file optiondlg.c.
Referenced by option_apply_callback(), option_apply_callback(), and option_dialog_reponse_callback().
|
inlinestatic |
Set the enum value of the option.
Definition at line 753 of file optiondlg.c.
Referenced by option_dialog_option_refresh(), and option_dialog_option_reset().
Set the boolean value of the option.
Definition at line 693 of file optiondlg.c.
Referenced by option_dialog_option_refresh(), and option_dialog_option_reset().
|
inlinestatic |
Set the font value of the option.
Definition at line 779 of file optiondlg.c.
Referenced by option_dialog_option_refresh(), and option_dialog_option_reset().
|
inlinestatic |
Set the enum value of the option.
Definition at line 728 of file optiondlg.c.
Referenced by option_dialog_option_refresh(), and option_dialog_option_reset().
|
inlinestatic |
Set the font value of the option.
Definition at line 769 of file optiondlg.c.
Referenced by option_dialog_option_refresh(), and option_dialog_option_reset().
|
inlinestatic |
Set the integer value of the option.
Definition at line 704 of file optiondlg.c.
Referenced by option_dialog_option_refresh(), and option_dialog_option_reset().
|
static |
Update an option in the option dialog.
Definition at line 813 of file optiondlg.c.
Referenced by option_dialog_option_add(), option_dialog_popup(), option_dialog_reponse_callback(), option_gui_update(), option_refresh_callback(), and option_refresh_callback().
|
static |
Remove an option from the option dialog.
Definition at line 671 of file optiondlg.c.
Referenced by option_gui_remove().
|
static |
Reset the option.
Definition at line 851 of file optiondlg.c.
Referenced by option_dialog_reponse_callback(), option_reset_callback(), and option_reset_callback().
|
inlinestatic |
Set the string value of the option.
Definition at line 714 of file optiondlg.c.
Referenced by option_dialog_option_refresh(), and option_dialog_option_reset().
|
static |
Utility for sorting the pages of an option dialog.
Definition at line 438 of file optiondlg.c.
Referenced by option_dialog_reorder_notebook().
void option_dialog_popdown | ( | const struct option_set * | poptset | ) |
Popdown the option dialog for the option set.
Definition at line 993 of file optiondlg.c.
Referenced by server_options_free().
void option_dialog_popup | ( | const char * | name, |
const struct option_set * | poptset | ||
) |
Popup the option dialog for the option set.
Definition at line 979 of file optiondlg.c.
Referenced by client_options_callback(), game_options_callback(), local_options_callback(), local_options_callback(), open_settings(), fc_client::popup_client_options(), pregame_options::popup_server_options(), server_options_callback(), server_options_callback(), and server_options_callback().
|
static |
Reoder the pages of the notebook of the option dialog.
Definition at line 450 of file optiondlg.c.
Referenced by option_dialog_new(), and option_dialog_option_add().
|
static |
Option dialog widget response callback.
Definition at line 97 of file optiondlg.c.
Referenced by option_dialog_new().
void option_gui_add | ( | struct option * | poption | ) |
Add the GUI for the option.
Definition at line 1034 of file optiondlg.c.
void option_gui_remove | ( | struct option * | poption | ) |
Remove the GUI for the option.
Definition at line 1048 of file optiondlg.c.
Referenced by server_option_free().
void option_gui_update | ( | struct option * | poption | ) |
Update the GUI for the option.
Definition at line 1020 of file optiondlg.c.
Referenced by option_changed().
|
static |
Pass on updated option values to controls outside the main option dialogs.
Definition at line 1006 of file optiondlg.c.
Referenced by option_gui_add(), and option_gui_update().
|
static |
Option refresh requested from menu.
Definition at line 143 of file optiondlg.c.
Referenced by option_button_press_callback(), and option_button_press_callback().
|
static |
Option reset requested from menu.
Definition at line 156 of file optiondlg.c.
Referenced by option_button_press_callback(), and option_button_press_callback().
|
static |
Definition at line 58 of file optiondlg.c.
Referenced by option_dialog_destroy(), option_dialog_get(), and option_dialog_new().