23#include <gdk/gdkkeysyms.h>
61#define NEG_VAL(x) ((x)<0 ? (x) : (-x))
64#define CMA_NONE (10000)
65#define CMA_CUSTOM (10001)
81 GtkTreeViewColumn *col, gpointer data);
107#define CRD_COL_CITY_ID (0 + NUM_CREPORT_COLS)
195 model_types[i] = G_TYPE_STRING;
199 model_types[i++] = G_TYPE_INT;
201 return gtk_list_store_newv(i, model_types);
218 gtk_list_store_set(store, iter, i, buf, -1);
233 return ((NULL != pcity
243 const struct city *pcity)
245 const int searched = pcity->
id;
248 if (gtk_tree_model_get_iter_first(model, iter)) {
251 if (searched ==
id) {
254 }
while (gtk_tree_model_iter_next(model, iter));
263 GtkTreeSelection *selection, GHashTable *select)
269 gtk_list_store_append(store, &iter);
272 && g_hash_table_remove(select, GINT_TO_POINTER(pcity->id))) {
273 gtk_tree_selection_select_iter(selection, &iter);
279 gtk_list_store_append(store, &iter);
282 && g_hash_table_remove(select, GINT_TO_POINTER(pcity->id))) {
283 gtk_tree_selection_select_iter(selection, &iter);
334 int i,
item, targets_used;
338 GtkSizeGroup *group[3];
339 const char *markup[3] = {
345 menu = gtk_menu_new();
346 gtk_menu_item_set_submenu(parent_item, menu);
348 if (city_operation !=
CO_NONE) {
351 int num_selected = 0;
352 GtkTreeModel *model = GTK_TREE_MODEL(
city_model);
355 selected = g_ptr_array_sized_new(
size);
365 g_ptr_array_add(selected, pcity);
369 data = (
struct city **)g_ptr_array_free(selected,
FALSE);
376 append_wonders,
FALSE,
381 city_operation !=
CO_NONE, NULL);
383 for (i = 0; i < 4; i++) {
387 g_object_set_data(G_OBJECT(menu),
"freeciv_test_func",
test_func);
388 g_object_set_data(G_OBJECT(menu),
"freeciv_city_operation",
389 GINT_TO_POINTER(city_operation));
391 for (i = 0; i < 3; i++) {
392 group[i] = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
397 GtkWidget *menu_item, *hbox, *label;
402 menu_item = gtk_menu_item_new();
403 hbox = gtk_grid_new();
404 gtk_grid_set_column_spacing(GTK_GRID(hbox), 18);
405 gtk_container_add(GTK_CONTAINER(menu_item), hbox);
407 for (i = 0; i < 3; i++) {
408 if (row[i][0] ==
'\0') {
412 if (city_operation ==
CO_SELL && i != 0) {
419 label = gtk_label_new(NULL);
420 gtk_label_set_markup(GTK_LABEL(label), txt);
424 gtk_widget_set_halign(label, GTK_ALIGN_START);
425 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
428 gtk_widget_set_halign(label, GTK_ALIGN_END);
429 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
435 gtk_container_add(GTK_CONTAINER(hbox), label);
436 gtk_size_group_add_widget(group[i], label);
439 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
440 g_signal_connect(menu_item,
"activate",
callback,
444 for (i = 0; i < 3; i++) {
445 g_object_unref(group[i]);
448 gtk_widget_show_all(menu);
450 gtk_widget_set_sensitive(GTK_WIDGET(parent_item), (targets_used > 0));
457 GtkTreeIter *iter, gpointer data)
549 GtkTreeIter *iter, gpointer data)
570 GObject *parent = G_OBJECT(gtk_widget_get_parent(wdg));
573 GPOINTER_TO_INT(g_object_get_data(parent,
"freeciv_city_operation"));
576 if (city_operation ==
CO_NONE) {
577 GtkTreeModel *model = GTK_TREE_MODEL(
city_model);
584 if (NULL != pcity &&
test_func(pcity, &target)) {
589 GtkTreeSelectionForeachFunc foreach_func;
592 switch (city_operation) {
622 struct sell_data sd = { 0, 0, building };
629 buf = g_strdup_printf(
_(
"Are you sure you want to sell those %s?"), imprname);
630 w = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
631 GTK_MESSAGE_QUESTION,
632 GTK_BUTTONS_YES_NO,
"%s", buf);
634 res = gtk_dialog_run(GTK_DIALOG(w));
635 gtk_widget_destroy(w);
636 if (res == GTK_RESPONSE_NO) {
646 w = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
647 GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
648 PL_(
"Sold %d %s for %d gold.",
649 "Sold %d %s for %d gold.",
653 w = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
654 GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
655 _(
"No %s could be sold."),
659 g_signal_connect(w,
"response",
660 G_CALLBACK(gtk_widget_destroy), NULL);
661 gtk_window_present(GTK_WINDOW(w));
675 GtkTreeIter *iter, gpointer data)
678 int idx = GPOINTER_TO_INT(data);
696 int idx = GPOINTER_TO_INT(data);
697 GObject *parent = G_OBJECT(gtk_widget_get_parent(w));
699 GPOINTER_TO_INT(g_object_get_data(parent,
"freeciv_change_cma"));
705 GtkTreeModel *model = GTK_TREE_MODEL(
city_model);
724 }
else if (controlled) {
758 w = gtk_menu_item_get_submenu(parent_item);
759 if (w != NULL && gtk_widget_get_visible(w)) {
764 gtk_menu_item_set_submenu(parent_item, NULL);
767 menu = gtk_menu_new();
768 gtk_menu_item_set_submenu(parent_item, menu);
771 w = gtk_menu_item_new_with_label(
Q_(
"?cma:none"));
772 gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
779 gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
782 fc_assert(GPOINTER_TO_INT(GINT_TO_POINTER(i)) == i);
797 w = gtk_menu_item_new_with_label(
Q_(
"?cma:none"));
798 gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
818 w = gtk_menu_item_new_with_label(
Q_(
"?cma:custom"));
820 gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
821 g_signal_connect(w,
"activate",
840 gtk_menu_shell_append(GTK_MENU_SHELL(menu), w);
841 g_signal_connect(w,
"activate",
847 g_object_set_data(G_OBJECT(menu),
"freeciv_change_cma",
848 GINT_TO_POINTER(change_cma));
849 gtk_widget_show_all(menu);
858 GtkTreeIter *iter, gpointer data)
897 GtkTreeIter *iter, gpointer data)
938 GtkWidget *menu, *
item;
939 GtkMenuItem *parent_item;
947 callback = g_object_get_data(G_OBJECT(parent_item),
"item_callback");
950 menu = gtk_menu_item_get_submenu(parent_item);
951 if (menu != NULL && gtk_widget_get_visible(menu)) {
952 gtk_menu_shell_deactivate(GTK_MENU_SHELL(menu));
956 menu = gtk_menu_new();
957 gtk_menu_item_set_submenu(parent_item, menu);
964 gtk_container_forall(GTK_CONTAINER(menu),
965 (GtkCallback) gtk_widget_destroy, NULL);
969 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
976 item = gtk_menu_item_new_with_label(
_(
"(no worklists defined)"));
977 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
980 gtk_widget_show_all(menu);
990 GtkTreeViewColumn *col;
996 columns = gtk_tree_view_get_columns(
view);
998 for (p = columns; p != NULL; p = p->next) {
1000 spec = g_object_get_data(G_OBJECT(col),
"city_report_spec");
1001 gtk_tree_view_column_set_visible(col, spec->
show);
1004 g_list_free(columns);
1023 GtkWidget *menu, *
item;
1027 menu = gtk_menu_new();
1030 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1031 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
item), spec->
show);
1032 g_signal_connect(
item,
"toggled", G_CALLBACK(
toggle_view), (gpointer)spec);
1034 gtk_menu_item_set_submenu(GTK_MENU_ITEM(show_item), menu);
1042 GtkWidget *vbox, *sep, *menubar, *menu, *
item;
1044 vbox = gtk_grid_new();
1045 gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox),
1046 GTK_ORIENTATION_VERTICAL);
1047 sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
1048 gtk_container_add(GTK_CONTAINER(vbox), sep);
1051 gtk_container_add(GTK_CONTAINER(vbox), menubar);
1053 item = gtk_menu_item_new_with_mnemonic(
_(
"_Production"));
1055 gtk_menu_shell_append(GTK_MENU_SHELL(menubar),
item);
1057 menu = gtk_menu_new();
1058 gtk_menu_item_set_submenu(GTK_MENU_ITEM(
item), menu);
1060 item = gtk_menu_item_new_with_mnemonic(
_(
"Chan_ge"));
1061 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1064 item = gtk_menu_item_new_with_mnemonic(
_(
"Add _First"));
1065 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1068 item = gtk_menu_item_new_with_mnemonic(
_(
"Add _Next"));
1069 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1072 item = gtk_menu_item_new_with_mnemonic(
_(
"Add _2nd Last"));
1073 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1076 item = gtk_menu_item_new_with_mnemonic(
_(
"Add _Last"));
1077 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1080 item = gtk_separator_menu_item_new();
1081 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1083 item = gtk_menu_item_new_with_label(
_(
"Set Worklist"));
1084 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1085 g_object_set_data(G_OBJECT(
item),
"item_callback",
1089 item = gtk_menu_item_new_with_label(
_(
"Append Worklist"));
1090 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1091 g_object_set_data(G_OBJECT(
item),
"item_callback",
1095 item = gtk_menu_item_new_with_mnemonic(
_(
"Clear _Worklist"));
1096 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1097 g_signal_connect(
item,
"activate",
1100 item = gtk_menu_item_new_with_mnemonic(
_(
"Gover_nor"));
1102 gtk_menu_shell_append(GTK_MENU_SHELL(menubar),
item);
1105 item = gtk_menu_item_new_with_mnemonic(
_(
"S_ell"));
1106 gtk_menu_shell_append(GTK_MENU_SHELL(menubar),
item);
1110 item = gtk_menu_item_new_with_mnemonic(
_(
"_Select"));
1111 gtk_menu_shell_append(GTK_MENU_SHELL(menubar),
item);
1114 item = gtk_menu_item_new_with_mnemonic(
_(
"_Display"));
1115 gtk_menu_shell_append(GTK_MENU_SHELL(menubar),
item);
1124 GtkTreeIter *b, gpointer
data)
1126 gint col = GPOINTER_TO_INT(
data);
1130 gtk_tree_model_get(model, a, col, &str1, -1);
1131 gtk_tree_model_get(model, b, col, &str2, -1);
1144 static char **titles;
1145 static char (*buf)[128];
1147 GtkWidget *w, *sw, *menubar;
1166 PANGO_ELLIPSIZE_START);
1183 GTK_RESPONSE_CLOSE);
1199 gtk_widget_set_name(
city_view,
"small_font");
1200 g_signal_connect(
city_view,
"row_activated",
1203 gtk_tree_selection_set_mode(
city_selection, GTK_SELECTION_MULTIPLE);
1209 GtkCellRenderer *renderer;
1210 GtkTreeViewColumn *col;
1212 renderer = gtk_cell_renderer_text_new();
1213 col = gtk_tree_view_column_new_with_attributes(NULL, renderer,
1215 header = gtk_label_new(titles[i]);
1216 gtk_widget_set_tooltip_text(header, spec->
explanation);
1217 gtk_widget_show(header);
1218 gtk_tree_view_column_set_widget(col, header);
1219 gtk_tree_view_column_set_visible(col, spec->
show);
1220 gtk_tree_view_column_set_sort_column_id(col, i);
1221 gtk_tree_view_column_set_reorderable(col,
TRUE);
1222 g_object_set_data(G_OBJECT(col),
"city_report_spec", spec);
1223 gtk_tree_view_append_column(GTK_TREE_VIEW(
city_view), col);
1224 gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(
city_model), i,
1229 sw = gtk_scrolled_window_new(NULL, NULL);
1230 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
1231 GTK_SHADOW_ETCHED_IN);
1232 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1233 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
1234 gtk_container_add(GTK_CONTAINER(sw),
city_view);
1266 GtkTreeModel *model = GTK_TREE_MODEL(
city_model);
1283 GtkTreeModel *model = GTK_TREE_MODEL(
city_model);
1301 GtkTreeIter *iter, gpointer data)
1306 if (NULL == selected_pcity) {
1336 GtkTreeModel *model = GTK_TREE_MODEL(
city_model);
1360 GtkTreeIter *iter, gpointer data)
1364 if (NULL != pcity) {
1373 GtkTreeIter *iter, gpointer data)
1377 if (NULL != pcity) {
1386 GtkTreeIter *iter, gpointer data)
1390 if (NULL != pcity) {
1406 if (1 == gtk_tree_selection_count_selected_rows(
city_selection)) {
1428 GtkTreeViewColumn *col, gpointer data)
1430 GtkTreeModel *model;
1434 GdkModifierType mask;
1436 model = gtk_tree_view_get_model(
view);
1438 if (!gtk_tree_model_get_iter(model, &iter, path)) {
1442 win = gdk_get_default_root_window();
1443 seat = gdk_display_get_default_seat(gdk_window_get_display(win));
1445 gdk_window_get_device_position(win, gdk_seat_get_pointer(seat),
1448 if (!(mask & GDK_CONTROL_MASK)) {
1460 GHashTable *selected;
1469 selected = g_hash_table_new(NULL, NULL);
1474 g_hash_table_insert(selected, GINT_TO_POINTER(city_id), NULL);
1481 g_hash_table_destroy(selected);
1516 menu = gtk_menu_new();
1517 gtk_menu_item_set_submenu(GTK_MENU_ITEM(
item), menu);
1535 menu = gtk_menu_new();
1536 gtk_menu_item_set_submenu(GTK_MENU_ITEM(
item), menu);
1554 menu = gtk_menu_new();
1555 gtk_menu_item_set_submenu(GTK_MENU_ITEM(
item), menu);
1573 menu = gtk_menu_new();
1574 gtk_menu_item_set_submenu(GTK_MENU_ITEM(
item), menu);
1590 GtkWidget *menu, *
item;
1592 menu = gtk_menu_new();
1593 gtk_menu_item_set_submenu(GTK_MENU_ITEM(parent_item), menu);
1594 g_signal_connect(menu,
"show",
1597 item = gtk_menu_item_new_with_label(
_(
"Units"));
1598 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1601 item = gtk_menu_item_new_with_label(
_(
"Improvements"));
1602 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1605 item = gtk_menu_item_new_with_label(
_(
"Wonders"));
1606 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1617 menu = gtk_menu_new();
1618 gtk_menu_item_set_submenu(GTK_MENU_ITEM(
item), menu);
1755 gtk_menu_popdown(GTK_MENU(menu));
1764 children = gtk_container_get_children(GTK_CONTAINER(menu));
1766 n = g_list_length(children);
1768 g_list_free(children);
1778 menu = gtk_menu_new();
1779 gtk_menu_item_set_submenu(GTK_MENU_ITEM(
item), menu);
1782 item = gtk_menu_item_new_with_label(
_(
"All Cities"));
1783 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1784 g_signal_connect(
item,
"activate",
1787 item = gtk_menu_item_new_with_label(
_(
"No Cities"));
1788 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1789 g_signal_connect(
item,
"activate",
1792 item = gtk_menu_item_new_with_label(
_(
"Invert Selection"));
1793 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1794 g_signal_connect(
item,
"activate",
1798 item = gtk_separator_menu_item_new();
1799 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1802 item = gtk_menu_item_new_with_label(
_(
"Building Units"));
1803 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1804 g_signal_connect(
item,
"activate",
1808 item = gtk_menu_item_new_with_label(
_(
"Building Improvements"));
1809 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1810 g_signal_connect(
item,
"activate",
1814 item = gtk_menu_item_new_with_label(
_(
"Building Wonders"));
1815 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1816 g_signal_connect(
item,
"activate",
1821 item = gtk_separator_menu_item_new();
1822 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1826 gtk_menu_item_new_with_label(
_(
"Building Unit"));
1830 gtk_menu_item_new_with_label(
_(
"Building Improvement"));
1834 gtk_menu_item_new_with_label(
_(
"Building Wonder"));
1838 item = gtk_separator_menu_item_new();
1839 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1842 item = gtk_menu_item_new_with_label(
_(
"Coastal Cities"));
1843 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1844 g_signal_connect(
item,
"activate",
1853 item = gtk_separator_menu_item_new();
1854 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1864 gtk_menu_item_new_with_label(
_(
"Improvements in City"));
1868 gtk_menu_item_new_with_label(
_(
"Wonders in City"));
1872 item = gtk_separator_menu_item_new();
1873 gtk_menu_shell_append(GTK_MENU_SHELL(menu),
item);
1877 gtk_menu_item_new_with_label(
_(
"Available Units"));
1880 gtk_menu_item_new_with_label(
_(
"Available Improvements"));
1883 gtk_menu_item_new_with_label(
_(
"Available Wonders"));
1886 gtk_menu_item_new_with_label(
_(
"Citizen Governor"));
1965 GtkWidget *label, *
view;
1967 GtkTreeModel *model;
1968 GtkTreeSelection *sel;
1977 if (!
view || !label) {
1981 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(
view));
1982 rows = gtk_tree_selection_get_selected_rows(sel, &model);
1984 for (p = rows; p != NULL; p = p->next) {
1986 if (gtk_tree_model_get_iter(model, &iter, path)) {
1991 gtk_tree_path_free(path);
1996 gchar *buf = g_strdup_printf(
_(
"Total Buy Cost: %d"), total);
1998 gtk_label_set_text(GTK_LABEL(label), buf);
2001 gtk_label_set_text(GTK_LABEL(label), NULL);
2012 bool obs_may, plr_may;
2014 n = gtk_tree_selection_count_selected_rows(selection);
2042 if (NULL != pcity) {
2073 GtkTreeModel *model;
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
#define cities_iterate_end
#define city_list_iterate(citylist, pcity)
#define cities_iterate(pcity)
#define city_owner(_pcity_)
#define city_list_iterate_end
void get_city_dialog_production_row(char *buf[], size_t column_size, struct universal *target, struct city *pcity)
int city_set_worklist(struct city *pcity, const struct worklist *pworklist)
bool city_queue_insert(struct city *pcity, int position, struct universal *item)
bool city_queue_insert_worklist(struct city *pcity, int position, const struct worklist *worklist)
bool city_set_queue(struct city *pcity, const struct worklist *pqueue)
int city_change_production(struct city *pcity, struct universal *target)
int city_sell_improvement(struct city *pcity, Impr_type_id sell_id)
void popup_city_dialog(struct city *pcity)
void refresh_city_dialog(struct city *pcity)
bool can_city_sell_universal(const struct city *pcity, const struct universal *target)
struct city_report_spec * city_report_specs
int cityrepfield_compare(const char *str1, const char *str2)
bool can_client_issue_orders(void)
bool client_has_player(void)
bool city_unit_supported(const struct city *pcity, const struct universal *target)
void cityrep_buy(struct city *pcity)
void name_and_sort_items(struct universal *targets, int num_targets, struct item *items, bool show_cost, struct city *pcity)
cid cid_encode(struct universal target)
bool city_building_present(const struct city *pcity, const struct universal *target)
struct universal cid_decode(cid id)
bool can_city_build_now_client(const struct city *pcity, const struct universal *target)
bool city_unit_present(const struct city *pcity, const struct universal *target)
int collect_production_targets(struct universal *targets, struct city **selected_cities, int num_selected_cities, bool append_units, bool append_wonders, bool change_prod, TestCityFunc test_func)
#define MAX_NUM_PRODUCTION_TARGETS
bool(* TestCityFunc)(const struct city *, const struct universal *)
bool cm_are_parameter_equal(const struct cm_parameter *const p1, const struct cm_parameter *const p2)
bool cma_is_city_under_agent(const struct city *pcity, struct cm_parameter *parameter)
void cma_put_city_under_agent(struct city *pcity, const struct cm_parameter *const parameter)
void cma_release_city(struct city *pcity)
char * cmafec_preset_get_descr(int idx)
const struct cm_parameter * cmafec_preset_get_parameter(int idx)
int cmafec_preset_get_index_of_parameter(const struct cm_parameter *const parameter)
int cmafec_preset_num(void)
void connection_do_buffer(struct connection *pc)
void connection_do_unbuffer(struct connection *pc)
#define PL_(String1, String2, n)
struct city * game_city_by_number(int id)
struct global_worklist * global_worklist_by_id(int id)
const char * global_worklist_name(const struct global_worklist *pgwl)
int global_worklist_id(const struct global_worklist *pgwl)
const struct worklist * global_worklist_get(const struct global_worklist *pgwl)
#define global_worklists_iterate(pgwl)
#define global_worklists_iterate_end
static void append_worklist_foreach(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static GtkWidget * select_wonders_item
static void create_city_report_dialog(bool make_modal)
static GtkWidget * next_to_last_wonders_item
static GtkWidget * city_governor_command
static void city_invert_selection_callback(GtkMenuItem *item, gpointer data)
static GtkWidget * city_popup_command
static GtkWidget * select_cma_item
static void worklist_next_impr_or_unit_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static GtkWidget * last_wonders_item
static void create_first_menu(GtkWidget *item)
static void create_next_to_last_menu(GtkWidget *item)
static GtkWidget * city_total_buy_cost_label
static GtkWidget * city_buy_command
static void update_total_buy_cost(void)
static GtkWidget * change_units_item
void real_city_report_dialog_update(void *unused)
static GtkWidget * last_units_item
static void popup_next_to_last_menu(GtkMenuShell *menu, gpointer data)
void real_city_report_update_city(struct city *pcity)
static void create_next_menu(GtkWidget *item)
static void city_select_building_callback(GtkMenuItem *item, gpointer data)
static void popup_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void create_select_menu(GtkWidget *item)
static void city_activated_callback(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
static void select_impr_or_unit_callback(GtkWidget *wdg, gpointer data)
static void impr_or_unit_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static GtkWidget * select_improvements_item
static void city_model_fill(GtkListStore *store, GtkTreeSelection *selection, GHashTable *select)
static void center_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
void toggle_city_hilite(struct city *pcity, bool on_off)
static bool city_building_impr_or_unit(const struct city *pcity, const struct universal *target)
static GtkWidget * select_supported_item
static GtkWidget * select_bimprovement_item
static GtkWidget * select_units_item
static GtkWidget * select_island_item
static gint cityrep_sort_func(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data)
static GtkWidget * change_improvements_item
static struct city * city_model_get(GtkTreeModel *model, GtkTreeIter *iter)
static void append_impr_or_unit_to_menu_item(GtkMenuItem *parent_item, bool append_units, bool append_wonders, enum city_operation_type city_operation, TestCityFunc test_func, GCallback callback, int size)
static void city_select_coastal_callback(GtkMenuItem *item, gpointer data)
static void production_menu_shown(GtkWidget *widget, gpointer data)
static void popup_select_menu(GtkMenuShell *menu, gpointer data)
static void popup_first_menu(GtkMenuShell *menu, gpointer data)
static void city_command_callback(struct gui_dialog *dlg, int response, gpointer data)
static void city_model_set(GtkListStore *store, GtkTreeIter *iter, struct city *pcity)
static GtkWidget * last_improvements_item
static void city_clear_worklist_callback(GtkMenuItem *item, gpointer data)
static GtkListStore * city_model
static void clear_worklist_foreach_func(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static GtkWidget * city_sell_command
static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma)
static GtkWidget * select_bwonder_item
static void city_select_all_callback(GtkMenuItem *item, gpointer data)
static void popup_last_menu(GtkMenuShell *menu, gpointer data)
static void sell_impr_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static GtkTreeSelection * city_selection
static void create_last_menu(GtkWidget *item)
static void same_island_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static GtkWidget * change_wonders_item
static GtkWidget * first_improvements_item
static void city_select_same_island_callback(GtkMenuItem *item, gpointer data)
static GtkWidget * select_built_wonders_item
static void set_worklist_callback(GtkMenuItem *menuitem, gpointer data)
static void city_selection_changed_callback(GtkTreeSelection *selection)
static gboolean city_model_find(GtkTreeModel *model, GtkTreeIter *iter, const struct city *pcity)
static void worklist_next_to_last_impr_or_unit_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static GtkWidget * next_to_last_units_item
static GtkWidget * next_to_last_improvements_item
static GtkWidget * city_production_command
static GtkListStore * city_report_dialog_store_new(void)
static int city_dialog_shell_is_modal
static GtkWidget * create_city_report_menubar(void)
static void city_report_update_views(void)
static void get_city_table_header(char **text, int n)
static GtkWidget * select_bunit_item
void hilite_cities_from_canvas(void)
void city_report_dialog_popdown(void)
static void create_sell_menu(GtkWidget *item)
void city_report_dialog_popup(bool raise)
static GtkWidget * city_view
static GtkWidget * select_present_item
static void update_view_menu(GtkWidget *show_item)
static GtkWidget * select_built_improvements_item
static struct gui_dialog * city_dialog_shell
static void worklist_first_impr_or_unit_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static GtkWidget * next_improvements_item
static void popup_change_menu(GtkMenuShell *menu, gpointer data)
static void cma_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void set_worklist_foreach(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void toggle_view(GtkCheckMenuItem *item, gpointer data)
static void append_worklist_callback(GtkMenuItem *menuitem, gpointer data)
static void city_unselect_all_callback(GtkMenuItem *item, gpointer data)
static void popup_next_menu(GtkMenuShell *menu, gpointer data)
static void worklist_last_impr_or_unit_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static GtkWidget * next_wonders_item
static GtkWidget * first_units_item
static GtkWidget * next_units_item
static GtkWidget * first_wonders_item
static GtkWidget * city_center_command
static void buy_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void recreate_sell_menu(void)
static void create_change_menu(GtkWidget *item)
static void select_cma_callback(GtkWidget *w, gpointer data)
void gui_dialog_destroy(struct gui_dialog *dlg)
void gui_dialog_present(struct gui_dialog *dlg)
void gui_dialog_set_default_response(struct gui_dialog *dlg, int response)
void itree_get(ITree *it,...)
void gui_dialog_raise(struct gui_dialog *dlg)
void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook, gpointer user_data, bool check_top)
GtkWidget * gui_dialog_add_widget(struct gui_dialog *dlg, GtkWidget *widget)
void gui_dialog_response_set_callback(struct gui_dialog *dlg, GUI_DIALOG_RESPONSE_FUN fun)
void itree_begin(GtkTreeModel *model, ITree *it)
GtkWidget * gui_dialog_add_button(struct gui_dialog *dlg, const char *text, int response)
void itree_unselect(GtkTreeSelection *selection, ITree *it)
void gui_dialog_show_all(struct gui_dialog *dlg)
void itree_select(GtkTreeSelection *selection, ITree *it)
void gui_dialog_set_title(struct gui_dialog *dlg, const char *title)
void gui_dialog_set_default_size(struct gui_dialog *dlg, int width, int height)
void itree_next(ITree *it)
gboolean itree_is_selected(GtkTreeSelection *selection, ITree *it)
GtkWidget * gtk_aux_menu_bar_new(void)
gboolean itree_end(ITree *it)
int impr_sell_gold(const struct impr_type *pimprove)
Impr_type_id improvement_number(const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_action(condition, action)
bool is_city_hilited(struct city *pcity)
void center_tile_mapcanvas(const struct tile *ptile)
#define fc_realloc(ptr, sz)
struct client_options gui_options
struct city_list * cities
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
const char *(* func)(const struct city *pcity, const void *data)
struct universal production
struct city::@17::@20 client
bool center_when_popup_city
struct city_list * cities
const struct impr_type * target
int fc_snprintf(char *str, size_t n, const char *format,...)
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
#define tile_continent(_tile)
const struct impr_type * building
void worklist_init(struct worklist *pwl)
int worklist_length(const struct worklist *pwl)