Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/gui-gtk-3.0/citydlg.c File Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
citydlg.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <gtk/gtk.h>`
`#include <gdk/gdkkeysyms.h>`
`#include "bitvector.h"`
`#include "fcintl.h"`
`#include "log.h"`
`#include "mem.h"`
`#include "shared.h"`
`#include "support.h"`
`#include "city.h"`
`#include "game.h"`
`#include "map.h"`
`#include "movement.h"`
`#include "packets.h"`
`#include "player.h"`
`#include "unitlist.h"`
`#include "chatline_common.h"`
`#include "client_main.h"`
`#include "colors.h"`
`#include "control.h"`
`#include "climap.h"`
`#include "options.h"`
`#include "text.h"`
`#include "tilespec.h"`
`#include "cma_fec.h"`
`#include "choice_dialog.h"`
`#include "citizensinfo.h"`
`#include "cityrep.h"`
`#include "cma_fe.h"`
`#include "dialogs.h"`
`#include "graphics.h"`
`#include "gui_main.h"`
`#include "gui_stuff.h"`
`#include "happiness.h"`
`#include "helpdlg.h"`
`#include "inputdlg.h"`
`#include "mapview.h"`
`#include "repodlgs.h"`
`#include "wldlg.h"`
`#include "citydlg.h"`
`#include "speclist.h"`
`#include "specvec.h"`

Go to the source code of this file.

## Data Structures

struct | unit_node
struct | city_map_canvas
struct | city_dialog

## Macros

#define | CITYMAP_WIDTH MIN(512, canvas_width)
#define | CITYMAP_HEIGHT (CITYMAP_WIDTH * canvas_height / canvas_width)
#define | CITYMAP_SCALE ((double)CITYMAP_WIDTH / (double)canvas_width)
#define | TINYSCREEN_MAX_HEIGHT (500 - 1)
#define | SPECLIST_TAG dialog
#define | SPECLIST_TYPE struct city_dialog
#define | dialog_list_iterate(dialoglist, pdialog) TYPED_LIST_ITERATE(struct city_dialog, dialoglist, pdialog)
#define | dialog_list_iterate_end LIST_ITERATE_END
#define | SPECVEC_TAG unit_node
#define | SPECVEC_TYPE struct unit_node
#define | unit_node_vector_iterate(list, elt) TYPED_VECTOR_ITERATE(struct unit_node, list, elt)
#define | unit_node_vector_iterate_end VECTOR_ITERATE_END
#define | NUM_CITIZENS_SHOWN 30
#define | CITY_MAP_MIN_SIZE_X 200
#define | CITY_MAP_MIN_SIZE_Y 150

## Enumerations

enum | citydlg_response { CDLGR_UNITS , CDLGR_PREV , CDLGR_NEXT }
enum | { OVERVIEW_PAGE , WORKLIST_PAGE , HAPPINESS_PAGE , CMA_PAGE , SETTINGS_PAGE , STICKY_PAGE , NUM_PAGES }

enum

{
INFO_SIZE , INFO_FOOD , INFO_SHIELD , INFO_TRADE ,
INFO_GOLD , INFO_LUXURY , INFO_SCIENCE , INFO_GRANARY ,
INFO_GROWTH , INFO_CORRUPTION , INFO_WASTE , INFO_CULTURE ,
INFO_POLLUTION , INFO_ILLNESS , INFO_STEAL , INFO_AIRLIFT ,
NUM_INFO_FIELDS
}

## Functions

static void | initialize_city_dialogs (void)
static void | city_dialog_map_create (struct city_dialog *pdialog, struct city_map_canvas *cmap_canvas)
static void | city_dialog_map_recenter (GtkWidget *map_canvas_sw)
static struct city_dialog * | get_city_dialog (struct city *pcity)
static gboolean | keyboard_handler (GtkWidget *widget, GdkEventKey *event, struct city_dialog *pdialog)
static GtkWidget * | create_city_info_table (struct city_dialog *pdialog, GtkWidget **info_ebox, GtkWidget **info_label)
static void | create_and_append_overview_page (struct city_dialog *pdialog)
static void | create_and_append_map_page (struct city_dialog *pdialog)
static void | create_and_append_buildings_page (struct city_dialog *pdialog)
static void | create_and_append_worklist_page (struct city_dialog *pdialog)
static void | create_and_append_happiness_page (struct city_dialog *pdialog)
static void | create_and_append_cma_page (struct city_dialog *pdialog)
static void | create_and_append_settings_page (struct city_dialog *pdialog)
static struct city_dialog * | create_city_dialog (struct city *pcity)
static void | city_dialog_update_title (struct city_dialog *pdialog)
static void | city_dialog_update_citizens (struct city_dialog *pdialog)
static void | city_dialog_update_information (GtkWidget **info_ebox, GtkWidget **info_label, struct city_dialog *pdialog)
static void | city_dialog_update_map (struct city_dialog *pdialog)
static void | city_dialog_update_building (struct city_dialog *pdialog)
static void | city_dialog_update_improvement_list (struct city_dialog *pdialog)
static void | city_dialog_update_supported_units (struct city_dialog *pdialog)
static void | city_dialog_update_present_units (struct city_dialog *pdialog)
static void | city_dialog_update_prev_next (void)
static void | show_units_response (void *data)
static gboolean | supported_unit_callback (GtkWidget *w, GdkEventButton *ev, gpointer data)
static gboolean | present_unit_callback (GtkWidget *w, GdkEventButton *ev, gpointer data)
static gboolean | supported_unit_middle_callback (GtkWidget *w, GdkEventButton *ev, gpointer data)
static gboolean | present_unit_middle_callback (GtkWidget *w, GdkEventButton *ev, gpointer data)
static void | unit_center_callback (GtkWidget *w, gpointer data)
static void | unit_activate_callback (GtkWidget *w, gpointer data)
static void | supported_unit_activate_close_callback (GtkWidget *w, gpointer data)
static void | present_unit_activate_close_callback (GtkWidget *w, gpointer data)
static void | unit_load_callback (GtkWidget *w, gpointer data)
static void | unit_unload_callback (GtkWidget *w, gpointer data)
static void | unit_sentry_callback (GtkWidget *w, gpointer data)
static void | unit_fortify_callback (GtkWidget *w, gpointer data)
static void | unit_disband_callback (GtkWidget *w, gpointer data)
static void | unit_homecity_callback (GtkWidget *w, gpointer data)
static void | unit_upgrade_callback (GtkWidget *w, gpointer data)
static gboolean | citizens_callback (GtkWidget *w, GdkEventButton *ev, gpointer data)
static gboolean | button_down_citymap (GtkWidget *w, GdkEventButton *ev, gpointer data)
static void | draw_map_canvas (struct city_dialog *pdialog)
static void | buy_callback (GtkWidget *w, gpointer data)
static void | change_production_callback (GtkComboBox *combo, struct city_dialog *pdialog)
static void | sell_callback (struct impr_type *pimprove, gpointer data)
static void | sell_callback_response (GtkWidget *w, gint response, gpointer data)
static void | impr_callback (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
static void | rename_callback (GtkWidget *w, gpointer data)
static void | rename_popup_callback (gpointer data, gint response, const char *input)
static void | set_cityopt_values (struct city_dialog *pdialog)
static void | cityopt_callback (GtkWidget *w, gpointer data)
static void | misc_whichtab_callback (GtkWidget *w, gpointer data)
static void | city_destroy_callback (GtkWidget *w, gpointer data)
static void | close_city_dialog (struct city_dialog *pdialog)
static void | citydlg_response_callback (GtkDialog *dlg, gint response, void *data)
static void | close_callback (GtkWidget *w, gpointer data)
static void | switch_city_callback (GtkWidget *w, gpointer data)
static void | init_citydlg_dimensions (void)
void | reset_city_dialogs (void)
static gboolean | canvas_exposed_cb (GtkWidget *w, cairo_t *cr, gpointer data)
void | real_city_dialog_refresh (struct city *pcity)
void | refresh_unit_city_dialogs (struct unit *punit)
void | real_city_dialog_popup (struct city *pcity)
bool | city_dialog_is_open (struct city *pcity)
void | popdown_city_dialog (struct city *pcity)
void | popdown_all_city_dialogs (void)
static gboolean | show_info_button_release (GtkWidget *w, GdkEventButton *ev, gpointer data)
static gboolean | show_info_popup (GtkWidget *w, GdkEventButton *ev, gpointer data)
static void | create_citydlg_main_map (struct city_dialog *pdialog, GtkWidget *container)
static GtkWidget * | create_citydlg_improvement_list (struct city_dialog *pdialog, GtkWidget *vbox)
static void | target_drag_data_received (GtkWidget *w, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint info, guint time, gpointer user_data)
static void | create_production_header (struct city_dialog *pdialog, GtkContainer *contain)
static void | city_menu_position (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data)
static void | destroy_func (GtkWidget *w, gpointer data)
static void | set_city_workertask (GtkWidget *w, gpointer data)
static void | workertask_dlg_destroy (GtkWidget *w, gpointer data)
static void | popup_workertask_dlg (struct city *pcity, struct tile *ptile)
static void | buy_callback_response (GtkWidget *w, gint response, gpointer data)

## Variables

static struct dialog_list * | dialog_list
static bool | city_dialogs_have_been_initialised = FALSE
static int | canvas_width
static int | canvas_height
static int | new_dialog_def_page = OVERVIEW_PAGE
static int | last_page = OVERVIEW_PAGE
static bool | is_showing_workertask_dialog = FALSE
struct { |
struct city * owner |
struct tile * loc |
} | workertask_req |
static bool | low_citydlg

## Macro Definition Documentation

## ◆ CITY_MAP_MIN_SIZE_X

#define CITY_MAP_MIN_SIZE_X 200

Definition at line 127 of file citydlg.c.

## ◆ CITY_MAP_MIN_SIZE_Y

#define CITY_MAP_MIN_SIZE_Y 150

Definition at line 128 of file citydlg.c.

## ◆ CITYMAP_HEIGHT

#define CITYMAP_HEIGHT (CITYMAP_WIDTH * canvas_height / canvas_width)

Definition at line 74 of file citydlg.c.

## ◆ CITYMAP_SCALE

#define CITYMAP_SCALE ((double)CITYMAP_WIDTH / (double)canvas_width)

Definition at line 75 of file citydlg.c.

## ◆ CITYMAP_WIDTH

#define CITYMAP_WIDTH MIN(512, canvas_width)

Definition at line 73 of file citydlg.c.

## ◆ dialog_list_iterate

#define dialog_list_iterate | ( |  | dialoglist,
|  |  | pdialog
| ) |  | TYPED_LIST_ITERATE(struct city_dialog, dialoglist, pdialog)

Definition at line 90 of file citydlg.c.

## ◆ dialog_list_iterate_end

#define dialog_list_iterate_end LIST_ITERATE_END

Definition at line 92 of file citydlg.c.

## ◆ NUM_CITIZENS_SHOWN

#define NUM_CITIZENS_SHOWN 30

Definition at line 109 of file citydlg.c.

## ◆ SPECLIST_TAG

#define SPECLIST_TAG dialog

Definition at line 86 of file citydlg.c.

## ◆ SPECLIST_TYPE

#define SPECLIST_TYPE struct city_dialog

Definition at line 87 of file citydlg.c.

## ◆ SPECVEC_TAG

#define SPECVEC_TAG unit_node

Definition at line 101 of file citydlg.c.

## ◆ SPECVEC_TYPE

#define SPECVEC_TYPE struct unit_node

Definition at line 102 of file citydlg.c.

## ◆ TINYSCREEN_MAX_HEIGHT

#define TINYSCREEN_MAX_HEIGHT (500 - 1)

Definition at line 77 of file citydlg.c.

## ◆ unit_node_vector_iterate

#define unit_node_vector_iterate | ( |  | list,
|  |  | elt
| ) |  | TYPED_VECTOR_ITERATE(struct unit_node, list, elt)

Definition at line 105 of file citydlg.c.

## ◆ unit_node_vector_iterate_end

#define unit_node_vector_iterate_end VECTOR_ITERATE_END

Definition at line 107 of file citydlg.c.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
OVERVIEW_PAGE |
WORKLIST_PAGE |
HAPPINESS_PAGE |
CMA_PAGE |
SETTINGS_PAGE |
STICKY_PAGE |
NUM_PAGES |

Definition at line 111 of file citydlg.c.

## ◆ anonymous enum

anonymous enum

Enumerator
INFO_SIZE |
INFO_FOOD |
INFO_SHIELD |
INFO_TRADE |
INFO_GOLD |
INFO_LUXURY |
INFO_SCIENCE |
INFO_GRANARY |
INFO_GROWTH |
INFO_CORRUPTION |
INFO_WASTE |
INFO_CULTURE |
INFO_POLLUTION |
INFO_ILLNESS |
INFO_STEAL |
INFO_AIRLIFT |
NUM_INFO_FIELDS |

Definition at line 117 of file citydlg.c.

## ◆ citydlg_response

enum citydlg_response

Enumerator
CDLGR_UNITS |
CDLGR_PREV |
CDLGR_NEXT |

Definition at line 81 of file citydlg.c.

## Function Documentation

## ◆ button_down_citymap()

static gboolean button_down_citymap | ( | GtkWidget * | w,
|  | GdkEventButton * | ev,
|  | gpointer | data
| ) |  |

static

User has pressed button on citymap

Definition at line 3011 of file citydlg.c.

Referenced by city_dialog_map_create().

## ◆ buy_callback()

static void buy_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has clicked buy-button

Definition at line 3074 of file citydlg.c.

Referenced by create_and_append_overview_page(), create_production_header(), and create_production_header().

## ◆ buy_callback_response()

static void buy_callback_response | ( | GtkWidget * | w,
|  | gint | response,
|  | gpointer | data
| ) |  |

static

User has answered buy cost dialog

Definition at line 3061 of file citydlg.c.

Referenced by buy_callback().

## ◆ canvas_exposed_cb()

static gboolean canvas_exposed_cb | ( | GtkWidget * | w,
|  | cairo_t * | cr,
|  | gpointer | data
| ) |  |

static

Redraw map canvas on expose.

Definition at line 396 of file citydlg.c.

Referenced by city_dialog_map_create().

## ◆ change_production_callback()

static void change_production_callback | ( | GtkComboBox * | combo,
|  | struct city_dialog * | pdialog
| ) |  |

static

Callback for the dropdown production menu.

Definition at line 3124 of file citydlg.c.

Referenced by create_and_append_overview_page().

## ◆ citizens_callback()

static gboolean citizens_callback | ( | GtkWidget * | w,
|  | GdkEventButton * | ev,
|  | gpointer | data
| ) |  |

static

Somebody clicked our list of citizens. If they clicked a specialist then change its type, else do nothing.

Definition at line 2836 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ city_destroy_callback()

static void city_destroy_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has closed rename city dialog

Definition at line 3346 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ city_dialog_is_open()

bool city_dialog_is_open | ( | struct city * | pcity | ) |

Return whether city dialog for given city is open

Definition at line 579 of file citydlg.c.

Referenced by city_packet_common(), popdown_city_cma_dialog(), popdown_city_dialog(), popdown_worklist_editor(), popup_hurry_production_dialog(), and real_city_dialog_refresh().

## ◆ city_dialog_map_create()

static void city_dialog_map_create | ( | struct city_dialog * | pdialog,
|  | struct city_map_canvas * | cmap_canvas
| ) |  |

static

Create a city map widget; used in the overview and in the happiness page.

Definition at line 415 of file citydlg.c.

Referenced by create_and_append_happiness_page(), create_citydlg_main_map(), and create_citydlg_main_map().

## ◆ city_dialog_map_recenter()

static void city_dialog_map_recenter | ( | GtkWidget * | map_canvas_sw | ) |

static

Center city dialog map.

Definition at line 454 of file citydlg.c.

Referenced by real_city_dialog_popup(), and switch_city_callback().

## ◆ city_dialog_update_building()

static void city_dialog_update_building | ( | struct city_dialog * | pdialog | ) |

static

Update what city is building and buy cost in city dialog

Definition at line 1926 of file citydlg.c.

Referenced by real_city_dialog_refresh().

## ◆ city_dialog_update_citizens()

static void city_dialog_update_citizens | ( | struct city_dialog * | pdialog | ) |

static

Update citizens in city dialog

Definition at line 1735 of file citydlg.c.

Referenced by real_city_dialog_refresh().

## ◆ city_dialog_update_improvement_list()

static void city_dialog_update_improvement_list | ( | struct city_dialog * | pdialog | ) |

static

Update list of improvements in city dialog

Definition at line 2048 of file citydlg.c.

Referenced by real_city_dialog_refresh().

## ◆ city_dialog_update_information()

static void city_dialog_update_information | ( | GtkWidget ** | info_ebox,
|  | GtkWidget ** | info_label,
|  | struct city_dialog * | pdialog
| ) |  |

static

Update textual info fields in city dialog

Definition at line 1798 of file citydlg.c.

Referenced by real_city_dialog_refresh().

## ◆ city_dialog_update_map()

static void city_dialog_update_map | ( | struct city_dialog * | pdialog | ) |

static

Update map display of city dialog

Definition at line 1904 of file citydlg.c.

Referenced by real_city_dialog_refresh(), and reset_city_dialogs().

## ◆ city_dialog_update_present_units()

static void city_dialog_update_present_units | ( | struct city_dialog * | pdialog | ) |

static

Update list of present units in city dialog

Definition at line 2211 of file citydlg.c.

Referenced by gui_refresh_unit_city_dialogs(), real_city_dialog_refresh(), and refresh_unit_city_dialogs().

## ◆ city_dialog_update_prev_next()

static void city_dialog_update_prev_next | ( | void |  | ) |

static

Updates the sensitivity of the prev and next buttons. this does not need pdialog as a parameter, since it iterates over all the open dialogs. note: we still need the sensitivity code in create_city_dialog() for the spied dialogs.

Definition at line 2318 of file citydlg.c.

Referenced by city_destroy_callback(), and create_city_dialog().

## ◆ city_dialog_update_supported_units()

static void city_dialog_update_supported_units | ( | struct city_dialog * | pdialog | ) |

static

Update list of supported units in city dialog

Definition at line 2105 of file citydlg.c.

Referenced by gui_refresh_unit_city_dialogs(), real_city_dialog_refresh(), and refresh_unit_city_dialogs().

## ◆ city_dialog_update_title()

static void city_dialog_update_title | ( | struct city_dialog * | pdialog | ) |

static

Update title of city dialog.

Definition at line 1696 of file citydlg.c.

Referenced by real_city_dialog_refresh().

## ◆ city_menu_position()

static void city_menu_position | ( | GtkMenu * | menu,
|  | gint * | x,
|  | gint * | y,
|  | gboolean * | push_in,
|  | gpointer | data
| ) |  |

static

Set city menu position

Definition at line 2380 of file citydlg.c.

Referenced by present_unit_callback(), and supported_unit_callback().

## ◆ citydlg_response_callback()

static void citydlg_response_callback | ( | GtkDialog * | dlg,
|  | gint | response,
|  | void * | data
| ) |  |

static

User clicked button from action area.

Definition at line 2354 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ cityopt_callback()

static void cityopt_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

City options callbacks

Definition at line 3279 of file citydlg.c.

Referenced by create_and_append_settings_page().

## ◆ close_callback()

static void close_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has clicked rename city-button

Definition at line 3338 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ close_city_dialog()

static void close_city_dialog | ( | struct city_dialog * | pdialog | ) |

static

Close city dialog

Definition at line 3401 of file citydlg.c.

Referenced by close_callback(), middle_present_unit_release(), middle_supported_unit_release(), popdown_all_city_dialogs(), popdown_city_dialog(), present_unit_activate_close_callback(), present_unit_activate_close_callback(), present_unit_middle_callback(), supported_unit_activate_close_callback(), supported_unit_activate_close_callback(), and supported_unit_middle_callback().

## ◆ create_and_append_buildings_page()

static void create_and_append_buildings_page | ( | struct city_dialog * | pdialog | ) |

static

Create buildings list page for small screens

Definition at line 1193 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ create_and_append_cma_page()

static void create_and_append_cma_page | ( | struct city_dialog * | pdialog | ) |

static

Citizen Management Agent (CMA) Page ****

Definition at line 1344 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ create_and_append_happiness_page()

static void create_and_append_happiness_page | ( | struct city_dialog * | pdialog | ) |

static

                         Happiness Page ****

+- GtkWidget *page -------—+----------------------------------------—+ | +- GtkWidget *left ---—+ | +- GtkWidget *right -----------------—+ | | | Info | | | City map | | | +- GtkWidget *citizens –+ | +- GtkWidget pdialog->happiness.widget -+ | | | Citizens data | | | Happiness | | | +---------------------—+ | +------------------------------------—+ | +-------------------------—+----------------------------------------—+

Definition at line 1271 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ create_and_append_map_page()

static void create_and_append_map_page | ( | struct city_dialog * | pdialog | ) |

static

Create map page for small screens

Definition at line 1099 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ create_and_append_overview_page()

static void create_and_append_overview_page | ( | struct city_dialog * | pdialog | ) |

static

                      Overview page ****

+- GtkWidget *page ---------------------------------------—+ | +- GtkWidget *middle --------—+---------------------—+ | | | City map | Production | | | +----------------------------—+---------------------—+ | +---------------------------------------------------------—+ | +- GtkWidget *bottom ----—+-------------------------—+ | | | Info | +- GtkWidget *right --—+ | | | | | | supported units | | | | | | +---------------------—+ | | | | | | present units | | | | | | +---------------------—+ | | | +------------------------—+-------------------------—+ | +---------------------------------------------------------—+

Definition at line 911 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ create_and_append_settings_page()

static void create_and_append_settings_page | ( | struct city_dialog * | pdialog | ) |

static

Misc. Settings Page ****

Definition at line 1364 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ create_and_append_worklist_page()

static void create_and_append_worklist_page | ( | struct city_dialog * | pdialog | ) |

static

Production Page ****

Definition at line 1227 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ create_city_dialog()

static struct city_dialog * create_city_dialog | ( | struct city * | pcity | ) |

static

                         Main City Dialog ****

+-------------------------—+----------------------------—+ | GtkWidget *top: Citizens | city name | +-------------------------—+----------------------------—+ | [notebook tab] | +---------------------------------------------------------—+

Definition at line 1508 of file citydlg.c.

Referenced by real_city_dialog_popup().

## ◆ create_city_info_table()

static GtkWidget * create_city_info_table | ( | struct city_dialog * | pdialog,
|  | GtkWidget ** | info_ebox,
|  | GtkWidget ** | info_label
| ) |  |

static

Used once in the overview page and once in the happiness page info_label points to the info_label in the respective struct

Definition at line 737 of file citydlg.c.

Referenced by create_and_append_happiness_page(), and create_and_append_overview_page().

## ◆ create_citydlg_improvement_list()

static GtkWidget * create_citydlg_improvement_list | ( | struct city_dialog * | pdialog,
|  | GtkWidget * | vbox
| ) |  |

static

Create improvements list

Definition at line 852 of file citydlg.c.

Referenced by create_and_append_buildings_page(), and create_and_append_overview_page().

## ◆ create_citydlg_main_map()

static void create_citydlg_main_map | ( | struct city_dialog * | pdialog,
|  | GtkWidget * | container
| ) |  |

static

Create main citydlg map

Definition at line 835 of file citydlg.c.

Referenced by create_and_append_map_page(), and create_and_append_overview_page().

## ◆ create_production_header()

static void create_production_header | ( | struct city_dialog * | pdialog,
|  | GtkContainer * | contain
| ) |  |

static

Create production page header - what tab this actually is, depends on screen size and layout.

Definition at line 1160 of file citydlg.c.

Referenced by create_and_append_buildings_page(), and create_and_append_worklist_page().

## ◆ destroy_func()

static void destroy_func | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

Destroy widget -callback

Definition at line 2407 of file citydlg.c.

Referenced by present_unit_callback(), and supported_unit_callback().

## ◆ draw_map_canvas()

static void draw_map_canvas | ( | struct city_dialog * | pdialog | ) |

static

Set map canvas to be drawn

Definition at line 3049 of file citydlg.c.

Referenced by city_dialog_update_map().

## ◆ get_city_dialog()

static struct city_dialog * get_city_dialog | ( | struct city * | pcity | ) |

static

Return city dialog of the given city, or NULL is it doesn't already exist

Definition at line 379 of file citydlg.c.

Referenced by city_dialog_is_open(), gui_refresh_unit_city_dialogs(), middle_present_unit_release(), middle_supported_unit_release(), popdown_city_dialog(), present_unit_activate_close_callback(), present_unit_activate_close_callback(), present_unit_callback(), present_unit_callback(), present_unit_middle_callback(), real_city_dialog_popup(), real_city_dialog_refresh(), refresh_unit_city_dialogs(), supported_unit_activate_close_callback(), supported_unit_activate_close_callback(), supported_unit_callback(), supported_unit_callback(), supported_unit_middle_callback(), and switch_city_callback().

## ◆ impr_callback()

static void impr_callback | ( | GtkTreeView * | view,
|  | GtkTreePath * | path,
|  | GtkTreeViewColumn * | col,
|  | gpointer | data
| ) |  |

static

This is here because it's closely related to the sell stuff

Definition at line 3197 of file citydlg.c.

Referenced by create_citydlg_improvement_list(), and create_citydlg_improvement_list().

## ◆ init_citydlg_dimensions()

static void init_citydlg_dimensions | ( | void |  | ) |

static

Called to set the dimensions of the city dialog, both on startup and if the tileset is changed.

Definition at line 324 of file citydlg.c.

Referenced by initialize_city_dialogs(), and reset_city_dialogs().

## ◆ initialize_city_dialogs()

static void initialize_city_dialogs | ( | void |  | ) |

static

Initialize stuff needed for city dialogs

Definition at line 333 of file citydlg.c.

Referenced by create_city_dialog(), and get_city_dialog().

## ◆ keyboard_handler()

static gboolean keyboard_handler | ( | GtkWidget * | widget,
|  | GdkEventKey * | event,
|  | struct city_dialog * | pdialog
| ) |  |

static

Keyboard handler for city dialog

Definition at line 616 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ misc_whichtab_callback()

static void misc_whichtab_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

Sets which page will be set on reopen of dialog

Definition at line 3271 of file citydlg.c.

Referenced by create_and_append_settings_page().

## ◆ popdown_all_city_dialogs()

void popdown_all_city_dialogs | ( | void |  | ) |

Popdown all dialogs

Definition at line 599 of file citydlg.c.

Referenced by handle_game_info(), popdown_all_game_dialogs(), reset_city_dialogs(), and set_client_state().

## ◆ popdown_city_dialog()

void popdown_city_dialog | ( | struct city * | pcity | ) |

Popdown the dialog

Definition at line 587 of file citydlg.c.

Referenced by activate_and_exit_units_orders_city_dlg_callback(), client_remove_city(), exit_city_dlg_callback(), popdown_all_city_dialogs(), and units_orders_city_dlg_callback().

## ◆ popup_workertask_dlg()

static void popup_workertask_dlg | ( | struct city * | pcity,
|  | struct tile * | ptile
| ) |  |

static

Open dialog for setting worker task

Definition at line 2927 of file citydlg.c.

Referenced by button_down_citymap(), and right_button_down_citymap().

## ◆ present_unit_activate_close_callback()

static void present_unit_activate_close_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested some present unit to be activated and city dialog to be closed

Definition at line 2707 of file citydlg.c.

Referenced by create_unit_menu(), and present_unit_callback().

## ◆ present_unit_callback()

static gboolean present_unit_callback | ( | GtkWidget * | w,
|  | GdkEventButton * | ev,
|  | gpointer | data
| ) |  |

static

Pop-up menu to change attributes of units, ex. change homecity.

Definition at line 2479 of file citydlg.c.

Referenced by city_dialog_update_present_units().

## ◆ present_unit_middle_callback()

static gboolean present_unit_middle_callback | ( | GtkWidget * | w,
|  | GdkEventButton * | ev,
|  | gpointer | data
| ) |  |

static

If user middle-clicked on a unit, activate it and close dialog

Definition at line 2599 of file citydlg.c.

Referenced by city_dialog_update_present_units().

## ◆ real_city_dialog_popup()

void real_city_dialog_popup | ( | struct city * | pcity | ) |

Popup the dialog 10% inside the main-window

Definition at line 558 of file citydlg.c.

Referenced by cities_update_callback().

## ◆ real_city_dialog_refresh()

void real_city_dialog_refresh | ( | struct city * | pcity | ) |

Refresh city dialog of the given city

Definition at line 481 of file citydlg.c.

Referenced by cities_update_callback(), create_city_dialog(), and switch_city_callback().

## ◆ refresh_unit_city_dialogs()

void refresh_unit_city_dialogs | ( | struct unit * | punit | ) |

Refresh city dialogs of unit's homecity and city where unit currently is.

Definition at line 538 of file citydlg.c.

Referenced by clear_unit_orders(), and handle_unit_packet_common().

## ◆ rename_callback()

static void rename_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

Called when Rename button pressed

Definition at line 3237 of file citydlg.c.

Referenced by create_and_append_settings_page().

## ◆ rename_popup_callback()

static void rename_popup_callback | ( | gpointer | data,
|  | gint | response,
|  | const char * | input
| ) |  |

static

Called when user has finished with "Rename City" popup

Definition at line 3254 of file citydlg.c.

Referenced by rename_callback().

## ◆ reset_city_dialogs()

void reset_city_dialogs | ( | void |  | ) |

Called when the tileset changes.

Definition at line 357 of file citydlg.c.

Referenced by tileset_changed().

## ◆ sell_callback()

static void sell_callback | ( | struct impr_type * | pimprove,
|  | gpointer | data
| ) |  |

static

User has clicked sell-button

Definition at line 3143 of file citydlg.c.

Referenced by impr_callback().

## ◆ sell_callback_response()

static void sell_callback_response | ( | GtkWidget * | w,
|  | gint | response,
|  | gpointer | data
| ) |  |

static

User has responded to sell price dialog

Definition at line 3182 of file citydlg.c.

Referenced by sell_callback().

## ◆ set_city_workertask()

static void set_city_workertask | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

Set requested workertask

Definition at line 2863 of file citydlg.c.

Referenced by popup_workertask_dlg().

## ◆ set_cityopt_values()

static void set_cityopt_values | ( | struct city_dialog * | pdialog | ) |

static

Refresh the city options (auto_[land, air, sea, helicopter] and disband-is-size-1) in the misc page.

Definition at line 3312 of file citydlg.c.

Referenced by create_and_append_settings_page(), and switch_city_callback().

## ◆ show_info_button_release()

static gboolean show_info_button_release | ( | GtkWidget * | w,
|  | GdkEventButton * | ev,
|  | gpointer | data
| ) |  |

static

Destroy info popup dialog when button released

Definition at line 640 of file citydlg.c.

Referenced by show_info_popup().

## ◆ show_info_popup()

static gboolean show_info_popup | ( | GtkWidget * | w,
|  | GdkEventButton * | ev,
|  | gpointer | data
| ) |  |

static

Popup info dialog

Definition at line 653 of file citydlg.c.

Referenced by create_city_info_table(), and create_city_info_table().

## ◆ show_units_response()

static void show_units_response | ( | void * | data | ) |

static

User has clicked show units

Definition at line 2367 of file citydlg.c.

Referenced by citydlg_response_callback().

## ◆ supported_unit_activate_close_callback()

static void supported_unit_activate_close_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested some supported unit to be activated and city dialog to be closed

Definition at line 2682 of file citydlg.c.

Referenced by create_unit_menu(), and supported_unit_callback().

## ◆ supported_unit_callback()

static gboolean supported_unit_callback | ( | GtkWidget * | w,
|  | GdkEventButton * | ev,
|  | gpointer | data
| ) |  |

static

Pop-up menu to change attributes of supported units

Definition at line 2415 of file citydlg.c.

Referenced by city_dialog_update_supported_units().

## ◆ supported_unit_middle_callback()

static gboolean supported_unit_middle_callback | ( | GtkWidget * | w,
|  | GdkEventButton * | ev,
|  | gpointer | data
| ) |  |

static

If user middle-clicked on a unit, activate it and close dialog

Definition at line 2627 of file citydlg.c.

Referenced by city_dialog_update_supported_units().

## ◆ switch_city_callback()

static void switch_city_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

Callback for the prev/next buttons. Switches to the previous/next city.

Definition at line 3410 of file citydlg.c.

Referenced by create_city_dialog().

## ◆ target_drag_data_received()

static void target_drag_data_received | ( | GtkWidget * | w,
|  | GdkDragContext * | context,
|  | gint | x,
|  | gint | y,
|  | GtkSelectionData * | data,
|  | guint | info,
|  | guint | time,
|  | gpointer | user_data
| ) |  |

static

Something dragged to worklist dialog.

Definition at line 1122 of file citydlg.c.

Referenced by create_production_header(), and create_production_header().

## ◆ unit_activate_callback()

static void unit_activate_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested unit activation

Definition at line 2668 of file citydlg.c.

Referenced by create_unit_menu(), present_unit_callback(), and supported_unit_callback().

## ◆ unit_center_callback()

static void unit_center_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested centering to unit

Definition at line 2655 of file citydlg.c.

Referenced by create_unit_menu(), and supported_unit_callback().

## ◆ unit_disband_callback()

static void unit_disband_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested unit to be disbanded

Definition at line 2782 of file citydlg.c.

Referenced by create_unit_menu(), present_unit_callback(), and supported_unit_callback().

## ◆ unit_fortify_callback()

static void unit_fortify_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested unit to be fortified

Definition at line 2769 of file citydlg.c.

Referenced by create_unit_menu(), and present_unit_callback().

## ◆ unit_homecity_callback()

static void unit_homecity_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested unit to change homecity to city where it currently is

Definition at line 2802 of file citydlg.c.

Referenced by create_unit_menu(), and present_unit_callback().

## ◆ unit_load_callback()

static void unit_load_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested unit to be loaded to transport

Definition at line 2730 of file citydlg.c.

Referenced by create_unit_menu(), and present_unit_callback().

## ◆ unit_sentry_callback()

static void unit_sentry_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested unit to be sentried

Definition at line 2756 of file citydlg.c.

Referenced by create_unit_menu(), and present_unit_callback().

## ◆ unit_unload_callback()

static void unit_unload_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested unit to be unloaded from transport

Definition at line 2743 of file citydlg.c.

Referenced by create_unit_menu(), and present_unit_callback().

## ◆ unit_upgrade_callback()

static void unit_upgrade_callback | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

User has requested unit to be upgraded

Definition at line 2815 of file citydlg.c.

Referenced by create_unit_menu(), and present_unit_callback().

## ◆ workertask_dlg_destroy()

static void workertask_dlg_destroy | ( | GtkWidget * | w,
|  | gpointer | data
| ) |  |

static

Destroy workertask dlg

Definition at line 2919 of file citydlg.c.

Referenced by popup_workertask_dlg().

## Variable Documentation

## ◆ canvas_height

int canvas_height

static

Definition at line 211 of file citydlg.c.

Referenced by button_down_citymap(), create_city_dialog(), init_citydlg_dimensions(), left_button_down_citymap(), and right_button_down_citymap().

## ◆ canvas_width

int canvas_width

static

Definition at line 211 of file citydlg.c.

Referenced by button_down_citymap(), create_city_dialog(), init_citydlg_dimensions(), left_button_down_citymap(), and right_button_down_citymap().

## ◆ city_dialogs_have_been_initialised

bool city_dialogs_have_been_initialised = FALSE

static

Definition at line 210 of file citydlg.c.

Referenced by create_city_dialog(), get_city_dialog(), initialize_city_dialogs(), popdown_all_city_dialogs(), reset_city_dialogs(), and switch_city_callback().

## ◆ dialog_list

struct dialog_list* dialog_list

static

Definition at line 209 of file citydlg.c.

Referenced by city_destroy_callback(), city_dialog_update_prev_next(), create_city_dialog(), get_city_dialog(), initialize_city_dialogs(), popdown_all_city_dialogs(), refresh_all_city_worklists(), and reset_city_dialogs().

## ◆ is_showing_workertask_dialog

bool is_showing_workertask_dialog = FALSE

static

Definition at line 215 of file citydlg.c.

Referenced by popup_workertask_dlg(), and workertask_dlg_destroy().

## ◆ last_page

int last_page = OVERVIEW_PAGE

static

Definition at line 213 of file citydlg.c.

Referenced by city_destroy_callback(), and create_and_append_settings_page().

## ◆ loc

struct tile* loc

Definition at line 220 of file citydlg.c.

Referenced by plocation_name(), usdata_destroy(), usdata_new(), usdlg_check_unit_location(), usdlg_cmd_center(), usdlg_cmd_cursor_changed(), usdlg_cmd_exec(), usdlg_cmd_focus(), usdlg_data_add_unit(), usdlg_refresh(), usdlg_tab_append_activity(), usdlg_tab_append_units(), usdlg_tab_append_utype(), usdlg_tab_select(), and usdlg_tab_update().

## ◆ low_citydlg

bool low_citydlg

static

Definition at line 223 of file citydlg.c.

Referenced by create_and_append_buildings_page(), create_and_append_cma_page(), create_and_append_happiness_page(), create_and_append_map_page(), create_and_append_overview_page(), create_and_append_worklist_page(), initialize_city_dialogs(), real_city_dialog_refresh(), and switch_city_callback().

## ◆ new_dialog_def_page

int new_dialog_def_page = OVERVIEW_PAGE

static

Definition at line 212 of file citydlg.c.

Referenced by create_and_append_settings_page(), and misc_whichtab_callback().

## ◆ owner

struct city* owner

Definition at line 219 of file citydlg.c.

Referenced by adv_could_be_my_zoc(), api_edit_unit_teleport(), api_edit_unit_teleport_old(), autosettler_tile_behavior(), begin_phase(), build_landarea_map(), building_lost(), citizen_happiness_nationality(), create_city_dialog(), destroy_extra(), do_nuke_tile(), do_paradrop(), dsend_packet_edit_city_create(), dsend_packet_edit_unit_create(), dsend_packet_edit_unit_remove(), fill_sprite_array(), get_potential_improvement_bonus(), get_unit_info_label_text2(), handle_edit_city_create(), handle_edit_unit_create(), handle_edit_unit_remove(), is_friendly_city_near(), map_claim_border(), map_update_border(), overview_tile_color(), paste_tile(), pixel_border_hexa(), pixel_border_isohexa(), pixel_border_rect(), player_clear(), player_in_territory(), popup_find_dialog(), popup_info_text(), real_city_dialog_popup(), rebuild_imprm_list(), receive_packet_city_info_100(), receive_packet_city_info_101(), receive_packet_city_info_102(), receive_packet_city_info_103(), receive_packet_city_short_info_100(), receive_packet_city_short_info_101(), receive_packet_edit_city_100(), receive_packet_edit_city_101(), receive_packet_edit_city_create_100(), receive_packet_edit_unit_100(), receive_packet_edit_unit_101(), receive_packet_edit_unit_create_100(), receive_packet_edit_unit_remove_100(), receive_packet_tile_info_100(), receive_packet_tile_info_101(), receive_packet_unit_info_100(), receive_packet_unit_info_101(), receive_packet_unit_short_info_100(), receive_packet_unit_short_info_101(), redraw_unit_info_label(), sdi_try_defend(), send_tile_info(), server_handle_packet(), sg_load_map_owner(), sg_load_map_owner(), show_delegations(), text_happiness_nationality(), unit_description(), unit_do_disband_trad(), hud_units::update_actions(), update_goto_dialog(), utype_build_shield_cost(), utype_buy_gold_cost(), vision_site_new(), and wonder_visible_to_player().

## ◆ [struct]

struct { ... } workertask_req

Referenced by popup_workertask_dlg(), and set_city_workertask().