Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-sdl3/optiondlg.c File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions | Variables
optiondlg.c File Reference
`#include <stdarg.h>`
`#include <stdlib.h>`
`#include <SDL3/SDL.h>`
`#include "fcintl.h"`
`#include "log.h"`
`#include "string_vector.h"`
`#include "fc_types.h"`
`#include "game.h"`
`#include "client_main.h"`
`#include "climisc.h"`
`#include "clinet.h"`
`#include "connectdlg_common.h"`
`#include "global_worklist.h"`
`#include "colors.h"`
`#include "connectdlg.h"`
`#include "dialogs.h"`
`#include "graphics.h"`
`#include "gui_id.h"`
`#include "gui_main.h"`
`#include "gui_tilespec.h"`
`#include "helpdlg.h"`
`#include "mapctrl.h"`
`#include "mapview.h"`
`#include "menu.h"`
`#include "messagewin.h"`
`#include "pages.h"`
`#include "themespec.h"`
`#include "widget.h"`
`#include "wldlg.h"`
`#include "optiondlg.h"`

Go to the source code of this file.

## Data Structures

struct | option_dialog_optset
struct | option_dialog_worklist
struct | option_dialog

## Enumerations

enum | option_dialog_mode { ODM_MAIN , ODM_OPTSET , ODM_WORKLIST }

## Functions

static struct widget * | option_widget_new (struct option *poption, struct widget *window, bool hide)
static void | option_widget_update (struct option *poption)
static void | option_widget_apply (struct option *poption)
static struct option_dialog * | option_dialog_new (void)
static void | option_dialog_destroy (struct option_dialog *pdialog)
static void | option_dialog_optset (struct option_dialog *pdialog, const struct option_set *poptset)
static void | option_dialog_optset_category (struct option_dialog *pdialog, int category)
static void | option_dialog_worklist (struct option_dialog *pdialog)
static void | arrange_widgets (struct widget *window, int widgets_per_row, int rows_shown, struct widget *begin, struct widget *end,...)
static int | main_optiondlg_callback (struct widget *pwindow)
static int | back_callback (struct widget *pwidget)
static int | client_options_callback (struct widget *pwidget)
static int | server_options_callback (struct widget *pwidget)
static int | work_lists_callback (struct widget *widget)
static int | save_client_options_callback (struct widget *pwidget)
static int | save_game_callback (struct widget *pwidget)
static int | help_browser_callback (struct widget *pwidget)
static int | disconnect_callback (struct widget *pwidget)
static int | exit_callback (struct widget *pwidget)
static int | option_category_callback (struct widget *widget)
static int | apply_callback (struct widget *widget)
static int | none_callback (struct widget *widget)
static struct strvec * | video_mode_list (void)
static void | enum_widget_destroy (struct widget *widget)
static void | video_mode_widget_destroy (struct widget *widget)
static int | optset_category_option_count (const struct option_set *poptset, int category)
static int | edit_worklist_callback (struct widget *widget)
static int | add_new_worklist_callback (struct widget *widget)
int | optiondlg_callback (struct widget *pbutton)
void | enable_options_button (void)
void | disable_options_button (void)
void | init_options_button (void)
void | update_worklist_report_dialog (void)
void | popup_optiondlg (void)
void | popdown_optiondlg (bool leave_game)
void | option_dialog_popup (const char *name, const struct option_set *poptset)
void | option_dialog_popdown (const struct option_set *poptset)
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 * | option_dialog = NULL
struct widget * | options_button = NULL
static bool | restore_meswin_dialog = FALSE

## Enumeration Type Documentation

## ◆ option_dialog_mode

enum option_dialog_mode

Enumerator
ODM_MAIN |
ODM_OPTSET |
ODM_WORKLIST |

Definition at line 68 of file optiondlg.c.

## Function Documentation

## ◆ add_new_worklist_callback()

static int add_new_worklist_callback | ( | struct widget * | widget | ) |

static

Callback to append a global worklist.

Definition at line 1164 of file optiondlg.c.

## ◆ apply_callback()

static int apply_callback | ( | struct widget * | widget | ) |

static

Apply the changes for the option category.

Definition at line 424 of file optiondlg.c.

## ◆ arrange_widgets()

static void arrange_widgets | ( | struct widget * | window,
|  | int | widgets_per_row,
|  | int | rows_shown,
|  | struct widget * | begin,
|  | struct widget * | end,
|  |  | ...
| ) |  |

static

Arrange the widgets. NB: end argument is excluded. End the argument list with the icons on the top, terminated by NULL.

Definition at line 123 of file optiondlg.c.

## ◆ back_callback()

static int back_callback | ( | struct widget * | pwidget | ) |

static

Back requested.

Definition at line 235 of file optiondlg.c.

## ◆ client_options_callback()

static int client_options_callback | ( | struct widget * | pwidget | ) |

static

Create the client options dialog.

Definition at line 311 of file optiondlg.c.

## ◆ disable_options_button()

void disable_options_button | ( | void |  | ) |

Disable button to open option dialog.

Definition at line 1388 of file optiondlg.c.

## ◆ disconnect_callback()

static int disconnect_callback | ( | struct widget * | pwidget | ) |

static

Client disconnect from server callback.

Definition at line 384 of file optiondlg.c.

## ◆ edit_worklist_callback()

static int edit_worklist_callback | ( | struct widget * | widget | ) |

static

Clicked on a global worklist name.

Definition at line 1106 of file optiondlg.c.

## ◆ enable_options_button()

void enable_options_button | ( | void |  | ) |

Enable button to open option dialog.

Definition at line 1380 of file optiondlg.c.

## ◆ enum_widget_destroy()

static void enum_widget_destroy | ( | struct widget * | widget | ) |

static

Free correctly the memory assigned to the enum_widget.

Definition at line 496 of file optiondlg.c.

## ◆ exit_callback()

static int exit_callback | ( | struct widget * | pwidget | ) |

static

Exit callback.

Definition at line 398 of file optiondlg.c.

## ◆ help_browser_callback()

static int help_browser_callback | ( | struct widget * | pwidget | ) |

static

Open Help Browser callback

Definition at line 372 of file optiondlg.c.

## ◆ init_options_button()

void init_options_button | ( | void |  | ) |

Create button to open option dialog.

Definition at line 1396 of file optiondlg.c.

## ◆ main_optiondlg_callback()

static int main_optiondlg_callback | ( | struct widget * | pwindow | ) |

static

User interacted with the option dialog window.

Definition at line 222 of file optiondlg.c.

## ◆ none_callback()

static int none_callback | ( | struct widget * | widget | ) |

static

Dummy callback. Disable exit().

Definition at line 443 of file optiondlg.c.

## ◆ option_category_callback()

static int option_category_callback | ( | struct widget * | widget | ) |

static

Option set category selected.

Definition at line 412 of file optiondlg.c.

## ◆ option_dialog_destroy()

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

static

Destroys an option dialog.

Definition at line 931 of file optiondlg.c.

## ◆ option_dialog_new()

static struct option_dialog * option_dialog_new | ( | void |  | ) |

static

Return a new option dialog.

Definition at line 802 of file optiondlg.c.

## ◆ option_dialog_optset()

static void option_dialog_optset | ( | struct option_dialog * | pdialog,
|  | const struct option_set * | poptset
| ) |  |

static

Initialize an option set page.

Definition at line 974 of file optiondlg.c.

## ◆ option_dialog_optset_category()

static void option_dialog_optset_category | ( | struct option_dialog * | pdialog,
|  | int | category
| ) |  |

static

Initialize an option set category page.

Definition at line 1025 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 1506 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 1486 of file optiondlg.c.

## ◆ option_dialog_worklist()

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

static

The Worklist Report part of Options dialog shows all the global worklists that the player has defined.

Definition at line 1237 of file optiondlg.c.

## ◆ option_gui_add()

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

Add the GUI for the option.

Definition at line 1535 of file optiondlg.c.

## ◆ option_gui_remove()

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

Remove the GUI for the option.

Definition at line 1549 of file optiondlg.c.

## ◆ option_gui_update()

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

Update the GUI for the option.

Definition at line 1518 of file optiondlg.c.

## ◆ option_widget_apply()

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

static

Apply the changes for the option.

Definition at line 731 of file optiondlg.c.

## ◆ option_widget_new()

static struct widget * option_widget_new | ( | struct option * | poption,
|  | struct widget * | window,
|  | bool | hide
| ) |  |

static

Create a widget for the option.

Definition at line 513 of file optiondlg.c.

## ◆ option_widget_update()

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

static

Update the widget of the option.

Definition at line 660 of file optiondlg.c.

## ◆ optiondlg_callback()

int optiondlg_callback | ( | struct widget * | pbutton | ) |

User interacted with the option dialog button.

Definition at line 1359 of file optiondlg.c.

## ◆ optset_category_option_count()

static int optset_category_option_count | ( | const struct option_set * | poptset,
|  | int | category
| ) |  |

static

Return the number of options of the category.

Definition at line 957 of file optiondlg.c.

## ◆ popdown_optiondlg()

void popdown_optiondlg | ( | bool | leave_game | ) |

Close option dialog.

Definition at line 1465 of file optiondlg.c.

## ◆ popup_optiondlg()

void popup_optiondlg | ( | void |  | ) |

Popup the main option menu dialog.

Definition at line 1446 of file optiondlg.c.

## ◆ save_client_options_callback()

static int save_client_options_callback | ( | struct widget * | pwidget | ) |

static

Option set category selected.

Definition at line 347 of file optiondlg.c.

## ◆ save_game_callback()

static int save_game_callback | ( | struct widget * | pwidget | ) |

static

Save game callback.

Definition at line 359 of file optiondlg.c.

## ◆ server_options_callback()

static int server_options_callback | ( | struct widget * | pwidget | ) |

static

Create the server options dialog.

Definition at line 323 of file optiondlg.c.

## ◆ update_worklist_report_dialog()

void update_worklist_report_dialog | ( | void |  | ) |

If the Options Dlg is open, force Worklist List contents to be updated. This function is call by exiting worklist editor to update changed worklist name in global worklist report ( Options Dlg )

Definition at line 1423 of file optiondlg.c.

## ◆ video_mode_list()

static struct strvec * video_mode_list | ( | void |  | ) |

static

Return a string vector containing all video modes.

Definition at line 451 of file optiondlg.c.

## ◆ video_mode_widget_destroy()

static void video_mode_widget_destroy | ( | struct widget * | widget | ) |

static

Free correctly the memory assigned to the video_mode_widget.

Definition at line 504 of file optiondlg.c.

## ◆ work_lists_callback()

static int work_lists_callback | ( | struct widget * | widget | ) |

static

Create the worklist editor.

Definition at line 335 of file optiondlg.c.

## Variable Documentation

## ◆ option_dialog

struct option_dialog* option_dialog = NULL

static

Definition at line 98 of file optiondlg.c.

## ◆ options_button

struct widget* options_button = NULL

Definition at line 99 of file optiondlg.c.

Referenced by close_game_page(), popup_minimap_window(), and real_menus_update().

## ◆ restore_meswin_dialog

bool restore_meswin_dialog = FALSE

static

Definition at line 100 of file optiondlg.c.