Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-gtk-5.0/optiondlg.c File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
optiondlg.c File Reference
`#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 (GSimpleAction *action, GVariant *parameter, gpointer data)
static void | option_reset_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
static void | option_apply_callback (GSimpleAction *action, GVariant *parameter, gpointer data)
static gboolean | option_button_press_callback (GtkGestureClick *gesture, int n_press, double x, double y, 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
static GtkWidget * | opt_popover = NULL

## Macro Definition Documentation

## ◆ option_dialogs_iterate

#define option_dialogs_iterate | ( |  | pdialog | ) | TYPED_LIST_ITERATE(struct option_dialog, option_dialogs, pdialog)

Definition at line 53 of file optiondlg.c.

## ◆ option_dialogs_iterate_end

#define option_dialogs_iterate_end LIST_ITERATE_END

Definition at line 55 of file optiondlg.c.

## ◆ SPECLIST_TAG

#define SPECLIST_TAG option_dialog

Definition at line 50 of file optiondlg.c.

## ◆ SPECLIST_TYPE

#define SPECLIST_TYPE struct option_dialog

Definition at line 51 of file optiondlg.c.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
RESPONSE_CANCEL |
RESPONSE_OK |
RESPONSE_APPLY |
RESPONSE_RESET |
RESPONSE_REFRESH |
RESPONSE_SAVE |

Definition at line 60 of file optiondlg.c.

## Function Documentation

## ◆ color_selector_response_callback()

static void color_selector_response_callback | ( | GtkDialog * | dialog,
|  | gint | res,
|  | gpointer | data
| ) |  |

static

"response" signal callback.

Definition at line 328 of file optiondlg.c.

## ◆ option_apply_callback()

static void option_apply_callback | ( | GSimpleAction * | action,
|  | GVariant * | parameter,
|  | gpointer | data
| ) |  |

static

Option apply requested from menu.

Definition at line 179 of file optiondlg.c.

## ◆ option_button_press_callback()

static gboolean option_button_press_callback | ( | GtkGestureClick * | gesture,
|  | int | n_press,
|  | double | x,
|  | double | y,
|  | gpointer | data
| ) |  |

static

Called when a button is pressed on an option.

Definition at line 196 of file optiondlg.c.

## ◆ option_color_destroy_notify()

static void option_color_destroy_notify | ( | gpointer | data | ) |

static

GDestroyNotify callback.

Definition at line 267 of file optiondlg.c.

## ◆ option_color_select_callback()

static void option_color_select_callback | ( | GtkButton * | button,
|  | gpointer | data
| ) |  |

static

Called when the user press a color button.

Definition at line 350 of file optiondlg.c.

## ◆ option_color_set_button_color()

static void option_color_set_button_color | ( | GtkButton * | button,
|  | const GdkRGBA * | new_color
| ) |  |

static

Set the color of a button.

Definition at line 279 of file optiondlg.c.

## ◆ option_dialog_destroy()

static void option_dialog_destroy | ( | struct option_dialog * | pdialog | ) |

static

Destroys an option dialog.

Definition at line 432 of file optiondlg.c.

## ◆ option_dialog_destroy_callback()

static void option_dialog_destroy_callback | ( | GtkWidget * | object,
|  | gpointer | data
| ) |  |

static

Option dialog widget destroyed callback.

Definition at line 131 of file optiondlg.c.

## ◆ option_dialog_foreach()

static void option_dialog_foreach | ( | struct option_dialog * | pdialog,
|  | void(*)(struct option *) | option_action
| ) |  |

inlinestatic

Do an action for all options of the option dialog.

Definition at line 492 of file optiondlg.c.

## ◆ option_dialog_get()

static struct option_dialog * option_dialog_get | ( | const struct option_set * | poptset | ) |

static

Returns the option dialog which fit the option set.

Definition at line 252 of file optiondlg.c.

## ◆ option_dialog_new()

static struct option_dialog * option_dialog_new | ( | const char * | name,
|  | const struct option_set * | poptset
| ) |  |

static

Creates a new option dialog.

Definition at line 379 of file optiondlg.c.

## ◆ option_dialog_option_add()

static void option_dialog_option_add | ( | struct option_dialog * | pdialog,
|  | struct option * | poption,
|  | bool | reorder_notebook
| ) |  |

static

Add an option to the option dialog.

Definition at line 506 of file optiondlg.c.

## ◆ option_dialog_option_apply()

static void option_dialog_option_apply | ( | struct option * | poption | ) |

static

Apply the option change.

Definition at line 922 of file optiondlg.c.

## ◆ option_dialog_option_bitwise_set()

static void option_dialog_option_bitwise_set | ( | struct option * | poption,
|  | unsigned | value
| ) |  |

inlinestatic

Set the enum value of the option.

Definition at line 789 of file optiondlg.c.

## ◆ option_dialog_option_bool_set()

static void option_dialog_option_bool_set | ( | struct option * | poption,
|  | bool | value
| ) |  |

inlinestatic

Set the boolean value of the option.

Definition at line 726 of file optiondlg.c.

## ◆ option_dialog_option_color_set()

static void option_dialog_option_color_set | ( | struct option * | poption,
|  | struct ft_color | color
| ) |  |

inlinestatic

Set the font value of the option.

Definition at line 815 of file optiondlg.c.

## ◆ option_dialog_option_enum_set()

static void option_dialog_option_enum_set | ( | struct option * | poption,
|  | int | value
| ) |  |

inlinestatic

Set the enum value of the option.

Definition at line 764 of file optiondlg.c.

## ◆ option_dialog_option_font_set()

static void option_dialog_option_font_set | ( | struct option * | poption,
|  | const char * | font
| ) |  |

inlinestatic

Set the font value of the option.

Definition at line 805 of file optiondlg.c.

## ◆ option_dialog_option_int_set()

static void option_dialog_option_int_set | ( | struct option * | poption,
|  | int | value
| ) |  |

inlinestatic

Set the integer value of the option.

Definition at line 737 of file optiondlg.c.

## ◆ option_dialog_option_refresh()

static void option_dialog_option_refresh | ( | struct option * | poption | ) |

static

Update an option in the option dialog.

Definition at line 849 of file optiondlg.c.

## ◆ option_dialog_option_remove()

static void option_dialog_option_remove | ( | struct option_dialog * | pdialog,
|  | struct option * | poption
| ) |  |

static

Remove an option from the option dialog.

Definition at line 703 of file optiondlg.c.

## ◆ option_dialog_option_reset()

static void option_dialog_option_reset | ( | struct option * | poption | ) |

static

Reset the option.

Definition at line 887 of file optiondlg.c.

## ◆ option_dialog_option_str_set()

static void option_dialog_option_str_set | ( | struct option * | poption,
|  | const char * | string
| ) |  |

inlinestatic

Set the string value of the option.

Definition at line 747 of file optiondlg.c.

## ◆ option_dialog_pages_sort_func()

static int option_dialog_pages_sort_func | ( | const void * | w1,
|  | const void * | w2
| ) |  |

static

Utility for sorting the pages of an option dialog.

Definition at line 458 of file optiondlg.c.

## ◆ option_dialog_popdown()

void option_dialog_popdown | ( | const struct option_set * | poptset | ) |

Popdown the option dialog for the option set.

Definition at line 1030 of file optiondlg.c.

## ◆ option_dialog_popup()

void option_dialog_popup | ( | const char * | name,
|  | const struct option_set * | poptset
| ) |  |

Popup the option dialog for the option set.

Definition at line 1016 of file optiondlg.c.

## ◆ option_dialog_reorder_notebook()

static void option_dialog_reorder_notebook | ( | struct option_dialog * | pdialog | ) |

static

Reorder the pages of the notebook of the option dialog.

Definition at line 470 of file optiondlg.c.

## ◆ option_dialog_reponse_callback()

static void option_dialog_reponse_callback | ( | GtkDialog * | dialog,
|  | gint | response_id,
|  | gpointer | data
| ) |  |

static

Option dialog widget response callback.

Definition at line 99 of file optiondlg.c.

## ◆ option_gui_add()

void option_gui_add | ( | struct option * | poption | ) |

Add the GUI for the option.

Definition at line 1071 of file optiondlg.c.

## ◆ option_gui_remove()

void option_gui_remove | ( | struct option * | poption | ) |

Remove the GUI for the option.

Definition at line 1085 of file optiondlg.c.

## ◆ option_gui_update()

void option_gui_update | ( | struct option * | poption | ) |

Update the GUI for the option.

Definition at line 1057 of file optiondlg.c.

## ◆ option_gui_update_extra()

static void option_gui_update_extra | ( | struct option * | poption | ) |

static

Pass on updated option values to controls outside the main option dialogs.

Definition at line 1043 of file optiondlg.c.

## ◆ option_refresh_callback()

static void option_refresh_callback | ( | GSimpleAction * | action,
|  | GVariant * | parameter,
|  | gpointer | data
| ) |  |

static

Option refresh requested from menu.

Definition at line 145 of file optiondlg.c.

## ◆ option_reset_callback()

static void option_reset_callback | ( | GSimpleAction * | action,
|  | GVariant * | parameter,
|  | gpointer | data
| ) |  |

static

Option reset requested from menu.

Definition at line 162 of file optiondlg.c.

## Variable Documentation

## ◆ opt_popover

GtkWidget* opt_popover = NULL

static

Definition at line 69 of file optiondlg.c.

## ◆ option_dialogs

struct option_dialog_list* option_dialogs = NULL

static

Definition at line 58 of file optiondlg.c.