Freeciv-3.2: /fast/freeciv/nightly/S3_2/client/gui-gtk-3.22/cityrep.c File Reference

Freeciv-3.2

Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions | Variables
cityrep.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <gtk/gtk.h>`
`#include <gdk/gdkkeysyms.h>`
`#include "fcintl.h"`
`#include "log.h"`
`#include "shared.h"`
`#include "support.h"`
`#include "city.h"`
`#include "game.h"`
`#include "packets.h"`
`#include "unit.h"`
`#include "cma_fec.h"`
`#include "citydlg_common.h"`
`#include "cityrepdata.h"`
`#include "client_main.h"`
`#include "climisc.h"`
`#include "global_worklist.h"`
`#include "mapview_common.h"`
`#include "options.h"`
`#include "chatline.h"`
`#include "citydlg.h"`
`#include "gui_main.h"`
`#include "gui_stuff.h"`
`#include "mapview.h"`
`#include "mapctrl.h"`
`#include "optiondlg.h"`
`#include "repodlgs.h"`
`#include "cityrep.h"`

Go to the source code of this file.

## Data Structures

struct | sell_data

## Macros

#define | NEG_VAL(x) ((x)<0 ? (x) : (-x))
#define | CMA_NONE (10000)
#define | CMA_CUSTOM (10001)
#define | CRD_COL_CITY_ID (0 + NUM_CREPORT_COLS)

## Enumerations

enum | city_operation_type { CO_CHANGE , CO_LAST , CO_NEXT , CO_FIRST , CO_NEXT_TO_LAST , CO_SELL , CO_NONE }
enum | { CITY_CENTER = 1 , CITY_POPUP , CITY_BUY }

## Functions

static void | create_city_report_dialog (bool make_modal)
static void | city_activated_callback (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
static void | city_command_callback (struct gui_dialog *dlg, int response, gpointer data)
static void | city_selection_changed_callback (GtkTreeSelection *selection)
static void | city_clear_worklist_callback (GtkMenuItem *item, gpointer data)
static void | update_total_buy_cost (void)
static void | create_select_menu (GtkWidget *item)
static void | create_change_menu (GtkWidget *item)
static void | create_last_menu (GtkWidget *item)
static void | create_first_menu (GtkWidget *item)
static void | create_next_menu (GtkWidget *item)
static void | create_next_to_last_menu (GtkWidget *item)
static void | create_sell_menu (GtkWidget *item)
static void | popup_select_menu (GtkMenuShell *menu, gpointer data)
static void | popup_change_menu (GtkMenuShell *menu, gpointer data)
static void | popup_last_menu (GtkMenuShell *menu, gpointer data)
static void | popup_first_menu (GtkMenuShell *menu, gpointer data)
static void | popup_next_menu (GtkMenuShell *menu, gpointer data)
static void | popup_next_to_last_menu (GtkMenuShell *menu, gpointer data)
static void | recreate_sell_menu (void)
static void | get_city_table_header (char **text, int n)
static GtkListStore * | city_report_dialog_store_new (void)
static void | city_model_set (GtkListStore *store, GtkTreeIter *iter, struct city *pcity)
static struct city * | city_model_get (GtkTreeModel *model, GtkTreeIter *iter)
static gboolean | city_model_find (GtkTreeModel *model, GtkTreeIter *iter, const struct city *pcity)
static void | city_model_fill (GtkListStore *store, GtkTreeSelection *selection, GHashTable *select)
void | city_report_dialog_popup (bool raise)
void | city_report_dialog_popdown (void)
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 | impr_or_unit_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | worklist_last_impr_or_unit_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | worklist_first_impr_or_unit_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | worklist_next_impr_or_unit_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | worklist_next_to_last_impr_or_unit_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | sell_impr_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | select_impr_or_unit_callback (GtkWidget *wdg, gpointer data)
static void | cma_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | select_cma_callback (GtkWidget *w, gpointer data)
static void | append_cma_to_menu_item (GtkMenuItem *parent_item, bool change_cma)
static void | append_worklist_foreach (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | append_worklist_callback (GtkMenuItem *menuitem, gpointer data)
static void | set_worklist_foreach (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | set_worklist_callback (GtkMenuItem *menuitem, gpointer data)
static void | production_menu_shown (GtkWidget *widget, gpointer data)
static void | city_report_update_views (void)
static void | toggle_view (GtkCheckMenuItem *item, gpointer data)
static void | update_view_menu (GtkWidget *show_item)
static GtkWidget * | create_city_report_menubar (void)
static gint | cityrep_sort_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data)
static void | city_select_all_callback (GtkMenuItem *item, gpointer data)
static void | city_unselect_all_callback (GtkMenuItem *item, gpointer data)
static void | city_invert_selection_callback (GtkMenuItem *item, gpointer data)
static void | city_select_coastal_callback (GtkMenuItem *item, gpointer data)
static void | same_island_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | city_select_same_island_callback (GtkMenuItem *item, gpointer data)
static void | city_select_building_callback (GtkMenuItem *item, gpointer data)
static void | buy_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | center_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
static void | popup_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
void | real_city_report_dialog_update (void *unused)
void | real_city_report_update_city (struct city *pcity)
static bool | city_building_impr_or_unit (const struct city *pcity, const struct universal *target)
static void | clear_worklist_foreach_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
void | hilite_cities_from_canvas (void)
void | toggle_city_hilite (struct city *pcity, bool on_off)

## Variables

static struct gui_dialog * | city_dialog_shell = NULL
static GtkWidget * | city_view
static GtkTreeSelection * | city_selection
static GtkListStore * | city_model
static GtkWidget * | city_center_command
static GtkWidget * | city_popup_command
static GtkWidget * | city_buy_command
static GtkWidget * | city_production_command
static GtkWidget * | city_governor_command
static GtkWidget * | city_sell_command
static GtkWidget * | city_total_buy_cost_label
static GtkWidget * | change_improvements_item
static GtkWidget * | change_units_item
static GtkWidget * | change_wonders_item
static GtkWidget * | last_improvements_item
static GtkWidget * | last_units_item
static GtkWidget * | last_wonders_item
static GtkWidget * | first_improvements_item
static GtkWidget * | first_units_item
static GtkWidget * | first_wonders_item
static GtkWidget * | next_improvements_item
static GtkWidget * | next_units_item
static GtkWidget * | next_wonders_item
static GtkWidget * | next_to_last_improvements_item
static GtkWidget * | next_to_last_units_item
static GtkWidget * | next_to_last_wonders_item
static GtkWidget * | select_island_item
static GtkWidget * | select_bunit_item
static GtkWidget * | select_bimprovement_item
static GtkWidget * | select_bwonder_item
static GtkWidget * | select_supported_item
static GtkWidget * | select_present_item
static GtkWidget * | select_built_improvements_item
static GtkWidget * | select_built_wonders_item
static GtkWidget * | select_improvements_item
static GtkWidget * | select_units_item
static GtkWidget * | select_wonders_item
static GtkWidget * | select_cma_item
static int | city_dialog_shell_is_modal
bool | select_menu_cached

## Macro Definition Documentation

## ◆ CMA_CUSTOM

#define CMA_CUSTOM (10001)

Definition at line 65 of file cityrep.c.

## ◆ CMA_NONE

#define CMA_NONE (10000)

Definition at line 64 of file cityrep.c.

## ◆ CRD_COL_CITY_ID

#define CRD_COL_CITY_ID (0 + NUM_CREPORT_COLS)

Definition at line 107 of file cityrep.c.

## ◆ NEG_VAL

#define NEG_VAL | ( |  | x | ) | ((x)<0 ? (x) : (-x))

Definition at line 61 of file cityrep.c.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
CITY_CENTER |
CITY_POPUP |
CITY_BUY |

Definition at line 100 of file cityrep.c.

## ◆ city_operation_type

enum city_operation_type

Enumerator
CO_CHANGE |
CO_LAST |
CO_NEXT |
CO_FIRST |
CO_NEXT_TO_LAST |
CO_SELL |
CO_NONE |

Definition at line 73 of file cityrep.c.

## Function Documentation

## ◆ append_cma_to_menu_item()

static void append_cma_to_menu_item | ( | GtkMenuItem * | parent_item,
|  | bool | change_cma
| ) |  |

static

Create the cma entries in the change menu and the select menu. The indices CMA_NONE and CMA_CUSTOM are special. CMA_NONE signifies a preset of "none" and CMA_CUSTOM a "custom" preset.

Definition at line 751 of file cityrep.c.

Referenced by create_city_report_menubar(), popup_select_menu(), and real_city_report_dialog_update().

## ◆ append_impr_or_unit_to_menu_item()

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

Make submenu listing possible build targets

Definition at line 322 of file cityrep.c.

Referenced by popup_change_menu(), popup_first_menu(), popup_last_menu(), popup_next_menu(), popup_next_to_last_menu(), popup_select_menu(), and recreate_sell_menu().

## ◆ append_worklist_callback()

static void append_worklist_callback | ( | GtkMenuItem * | menuitem,
|  | gpointer | data
| ) |  |

static

Menu item callback to append the global worklist associated with this item to the worklists of all selected cities. The worklist pointer is passed in 'data'.

Definition at line 875 of file cityrep.c.

Referenced by create_city_report_menubar(), and create_production_menu().

## ◆ append_worklist_foreach()

static void append_worklist_foreach | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Helper function to append a worklist to the current work list of one city in the city report. This function is called over all selected rows in the list view.

Definition at line 857 of file cityrep.c.

Referenced by append_worklist_callback(), and append_worklist_callback().

## ◆ buy_iterate()

static void buy_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Buy the production in one single city.

Definition at line 1355 of file cityrep.c.

Referenced by city_command_callback().

## ◆ center_iterate()

static void center_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Center to one single city.

Definition at line 1368 of file cityrep.c.

Referenced by city_activated_callback(), and city_command_callback().

## ◆ city_activated_callback()

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

static

User has selected city row from city report.

Definition at line 1423 of file cityrep.c.

Referenced by create_city_report_dialog().

## ◆ city_building_impr_or_unit()

static bool city_building_impr_or_unit | ( | const struct city * | pcity,
|  | const struct universal * | target
| ) |  |

static

Returns whether city is building given target

Definition at line 1889 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ city_clear_worklist_callback()

static void city_clear_worklist_callback | ( | GtkMenuItem * | item,
|  | gpointer | data
| ) |  |

static

Called when the "clear worklist" menu item is activated.

Definition at line 2049 of file cityrep.c.

Referenced by create_city_report_menubar(), and create_production_menu().

## ◆ city_command_callback()

static void city_command_callback | ( | struct gui_dialog * | dlg,
|  | int | response,
|  | gpointer | data
| ) |  |

static

gui_dialog response callback.

Definition at line 1397 of file cityrep.c.

Referenced by create_city_report_dialog().

## ◆ city_invert_selection_callback()

static void city_invert_selection_callback | ( | GtkMenuItem * | item,
|  | gpointer | data
| ) |  |

static

User has chosen to invert selection

Definition at line 1259 of file cityrep.c.

Referenced by create_select_menu(), and create_select_menu().

## ◆ city_model_fill()

static void city_model_fill | ( | GtkListStore * | store,
|  | GtkTreeSelection * | selection,
|  | GHashTable * | select
| ) |  |

static

Fill the model with the current configuration.

Definition at line 262 of file cityrep.c.

Referenced by create_city_report_dialog(), and real_city_report_dialog_update().

## ◆ city_model_find()

static gboolean city_model_find | ( | GtkTreeModel * | model,
|  | GtkTreeIter * | iter,
|  | const struct city * | pcity
| ) |  |

static

Return TRUE if 'iter' has been set to the city row.

Definition at line 242 of file cityrep.c.

Referenced by real_city_report_update_city(), and toggle_city_hilite().

## ◆ city_model_get()

static struct city * city_model_get | ( | GtkTreeModel * | model,
|  | GtkTreeIter * | iter
| ) |  |

static

Set the values of the iterator.

Definition at line 226 of file cityrep.c.

Referenced by append_impr_or_unit_to_menu(), append_impr_or_unit_to_menu_item(), append_worklist_foreach(), buy_iterate(), center_iterate(), city_select_building_callback(), city_select_building_callback(), city_select_coastal_callback(), city_select_coastal_callback(), clear_worklist_foreach_func(), cma_iterate(), governors_iterate(), hilite_cities_from_canvas(), impr_or_unit_iterate(), popup_iterate(), same_island_iterate(), select_cma_callback(), select_governor_callback(), select_impr_or_unit_callback(), select_impr_or_unit_callback(), sell_impr_iterate(), set_worklist_foreach(), update_total_buy_cost(), worklist_first_impr_or_unit_iterate(), worklist_last_impr_or_unit_iterate(), worklist_next_impr_or_unit_iterate(), and worklist_next_to_last_impr_or_unit_iterate().

## ◆ city_model_set()

static void city_model_set | ( | GtkListStore * | store,
|  | GtkTreeIter * | iter,
|  | struct city * | pcity
| ) |  |

static

Set the values of the iterator.

Definition at line 207 of file cityrep.c.

Referenced by city_model_fill(), and real_city_report_update_city().

## ◆ city_report_dialog_popdown()

void city_report_dialog_popdown | ( | void |  | ) |

Closes the city report dialog.

Definition at line 312 of file cityrep.c.

Referenced by exit_city_report_callback(), and popdown_all_game_dialogs().

## ◆ city_report_dialog_popup()

void city_report_dialog_popup | ( | bool | raise | ) |

Popup the city report dialog, and optionally raise it.

Definition at line 292 of file cityrep.c.

Referenced by cities_action_callback(), fc_client::create_game_page(), main_key_down_handler(), report_cities_callback(), report_cities_callback(), and mr_menu::slot_show_cities().

## ◆ city_report_dialog_store_new()

static GtkListStore * city_report_dialog_store_new | ( | void |  | ) |

static

Returns a new tree model for the city report.

Definition at line 188 of file cityrep.c.

Referenced by create_city_report_dialog().

## ◆ city_report_update_views()

static void city_report_update_views | ( | void |  | ) |

static

Update city report views

Definition at line 986 of file cityrep.c.

Referenced by toggle_view(), and toggle_view().

## ◆ city_select_all_callback()

static void city_select_all_callback | ( | GtkMenuItem * | item,
|  | gpointer | data
| ) |  |

static

User has chosen to select all cities

Definition at line 1243 of file cityrep.c.

Referenced by create_select_menu(), and create_select_menu().

## ◆ city_select_building_callback()

static void city_select_building_callback | ( | GtkMenuItem * | item,
|  | gpointer | data
| ) |  |

static

User has chosen to select cities with certain target in production

Definition at line 1328 of file cityrep.c.

Referenced by create_select_menu(), and create_select_menu().

## ◆ city_select_coastal_callback()

static void city_select_coastal_callback | ( | GtkMenuItem * | item,
|  | gpointer | data
| ) |  |

static

User has chosen to select coastal cities

Definition at line 1276 of file cityrep.c.

Referenced by create_select_menu(), and create_select_menu().

## ◆ city_select_same_island_callback()

static void city_select_same_island_callback | ( | GtkMenuItem * | item,
|  | gpointer | data
| ) |  |

static

User has chosen to select all cities on same island

Definition at line 1320 of file cityrep.c.

Referenced by create_select_menu().

## ◆ city_selection_changed_callback()

static void city_selection_changed_callback | ( | GtkTreeSelection * | selection | ) |

static

Update city report button sensitivity and total buy cost label when the user makes a change in the selection of cities.

Definition at line 2005 of file cityrep.c.

Referenced by create_city_report_dialog().

## ◆ city_unselect_all_callback()

static void city_unselect_all_callback | ( | GtkMenuItem * | item,
|  | gpointer | data
| ) |  |

static

User has chosen to unselect all cities

Definition at line 1251 of file cityrep.c.

Referenced by create_select_menu(), and create_select_menu().

## ◆ cityrep_sort_func()

static gint cityrep_sort_func | ( | GtkTreeModel * | model,
|  | GtkTreeIter * | a,
|  | GtkTreeIter * | b,
|  | gpointer | data
| ) |  |

static

Sort callback.

Definition at line 1123 of file cityrep.c.

Referenced by create_city_report_dialog().

## ◆ clear_worklist_foreach_func()

static void clear_worklist_foreach_func | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Clear the worklist in one selected city in the city report.

Definition at line 2031 of file cityrep.c.

Referenced by city_clear_worklist_callback(), and city_clear_worklist_callback().

## ◆ cma_iterate()

static void cma_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

CMA callback.

Definition at line 674 of file cityrep.c.

Referenced by select_cma_callback().

## ◆ create_change_menu()

static void create_change_menu | ( | GtkWidget * | item | ) |

static

Create submenu for changing production target

Definition at line 1508 of file cityrep.c.

Referenced by create_city_report_menubar(), and create_production_menu().

## ◆ create_city_report_dialog()

static void create_city_report_dialog | ( | bool | make_modal | ) |

static

Create city report dialog.

Definition at line 1138 of file cityrep.c.

Referenced by city_report_dialog_popup().

## ◆ create_city_report_menubar()

static GtkWidget * create_city_report_menubar | ( | void |  | ) |

static

Create menubar for city report

Definition at line 1040 of file cityrep.c.

Referenced by create_city_report_dialog().

## ◆ create_first_menu()

static void create_first_menu | ( | GtkWidget * | item | ) |

static

Creates the first menu.

Definition at line 1546 of file cityrep.c.

Referenced by create_city_report_menubar().

## ◆ create_last_menu()

static void create_last_menu | ( | GtkWidget * | item | ) |

static

Creates the last menu.

Definition at line 1527 of file cityrep.c.

Referenced by create_city_report_menubar().

## ◆ create_next_menu()

static void create_next_menu | ( | GtkWidget * | item | ) |

static

Creates the next menu.

Definition at line 1565 of file cityrep.c.

Referenced by create_city_report_menubar().

## ◆ create_next_to_last_menu()

static void create_next_to_last_menu | ( | GtkWidget * | parent_item | ) |

static

Append the "next to last" submenu to the given menu item.

Definition at line 1584 of file cityrep.c.

Referenced by create_city_report_menubar().

## ◆ create_select_menu()

static void create_select_menu | ( | GtkWidget * | item | ) |

static

Creates select menu

Definition at line 1770 of file cityrep.c.

Referenced by create_city_report_menubar(), and recreate_select_menu().

## ◆ create_sell_menu()

static void create_sell_menu | ( | GtkWidget * | item | ) |

static

Create the sell menu (empty).

Definition at line 1609 of file cityrep.c.

Referenced by create_city_report_menubar().

## ◆ get_city_table_header()

static void get_city_table_header | ( | char ** | text,
|  | int | n
| ) |  |

static

Return text line for the column headers for the city report

Definition at line 169 of file cityrep.c.

Referenced by create_city_report_dialog().

## ◆ hilite_cities_from_canvas()

void hilite_cities_from_canvas | ( | void |  | ) |

After a selection rectangle is defined, make the cities that are hilited on the canvas exclusively hilited in the City List window.

Definition at line 2066 of file cityrep.c.

Referenced by city_report_dialog_popup(), and define_tiles_within_rectangle().

## ◆ impr_or_unit_iterate()

static void impr_or_unit_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Change the production of one single selected city.

Definition at line 456 of file cityrep.c.

Referenced by select_impr_or_unit_callback(), and select_impr_or_unit_callback().

## ◆ popup_change_menu()

static void popup_change_menu | ( | GtkMenuShell * | menu,
|  | gpointer | data
| ) |  |

static

Pops up menu where user can select build target.

Definition at line 1620 of file cityrep.c.

Referenced by create_change_menu().

## ◆ popup_first_menu()

static void popup_first_menu | ( | GtkMenuShell * | menu,
|  | gpointer | data
| ) |  |

static

Pops up the first menu.

Definition at line 1666 of file cityrep.c.

Referenced by create_first_menu().

## ◆ popup_iterate()

static void popup_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Popup the dialog of a single city.

Definition at line 1381 of file cityrep.c.

Referenced by city_activated_callback(), and city_command_callback().

## ◆ popup_last_menu()

static void popup_last_menu | ( | GtkMenuShell * | menu,
|  | gpointer | data
| ) |  |

static

Pops up the last menu.

Definition at line 1643 of file cityrep.c.

Referenced by create_last_menu().

## ◆ popup_next_menu()

static void popup_next_menu | ( | GtkMenuShell * | menu,
|  | gpointer | data
| ) |  |

static

Pops up the next menu.

Definition at line 1689 of file cityrep.c.

Referenced by create_next_menu().

## ◆ popup_next_to_last_menu()

static void popup_next_to_last_menu | ( | GtkMenuShell * | menu,
|  | gpointer | data
| ) |  |

static

Re-create the submenus in the next-to-last production change menu.

Definition at line 1712 of file cityrep.c.

Referenced by create_next_to_last_menu().

## ◆ popup_select_menu()

static void popup_select_menu | ( | GtkMenuShell * | menu,
|  | gpointer | data
| ) |  |

static

Popup select menu

Definition at line 1898 of file cityrep.c.

Referenced by create_select_menu(), and create_select_menu().

## ◆ production_menu_shown()

static void production_menu_shown | ( | GtkWidget * | widget,
|  | gpointer | data
| ) |  |

static

Empty and refill the submenu of the menu item passed as 'data'. The menu will be filled with menu items corresponding to the global worklists.

Definition at line 936 of file cityrep.c.

Referenced by create_city_report_menubar().

## ◆ real_city_report_dialog_update()

void real_city_report_dialog_update | ( | void * | unused | ) |

Update the city report dialog

Definition at line 1454 of file cityrep.c.

Referenced by city_report_dialog_update().

## ◆ real_city_report_update_city()

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

Update the text for a single city in the city report

Definition at line 1489 of file cityrep.c.

Referenced by cities_update_callback().

## ◆ recreate_sell_menu()

static void recreate_sell_menu | ( | void |  | ) |

static

Update the sell menu.

Definition at line 1743 of file cityrep.c.

Referenced by city_selection_changed_callback(), and create_city_report_dialog().

## ◆ same_island_iterate()

static void same_island_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Select all cities on the same continent.

Definition at line 1296 of file cityrep.c.

Referenced by city_select_island_callback(), and city_select_same_island_callback().

## ◆ select_cma_callback()

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

static

Called when one clicks on an CMA item to make a selection or to change a selection's preset.

Definition at line 694 of file cityrep.c.

Referenced by append_cma_to_menu_item().

## ◆ select_impr_or_unit_callback()

static void select_impr_or_unit_callback | ( | GtkWidget * | wdg,
|  | gpointer | data
| ) |  |

static

Some build target, either improvement or unit, has been selected from some menu.

Definition at line 567 of file cityrep.c.

Referenced by create_change_menu(), create_select_menu(), popup_change_menu(), popup_first_menu(), popup_last_menu(), popup_next_menu(), popup_next_to_last_menu(), popup_select_menu(), recreate_sell_menu(), and recreate_sell_menu().

## ◆ sell_impr_iterate()

static void sell_impr_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Iterate the cities going to sell.

Definition at line 548 of file cityrep.c.

Referenced by select_impr_or_unit_callback(), and select_impr_or_unit_callback().

## ◆ set_worklist_callback()

static void set_worklist_callback | ( | GtkMenuItem * | menuitem,
|  | gpointer | data
| ) |  |

static

Menu item callback to set a city's worklist to the global worklist associated with this menu item. The worklist pointer is passed in 'data'.

Definition at line 913 of file cityrep.c.

Referenced by create_city_report_menubar(), and create_production_menu().

## ◆ set_worklist_foreach()

static void set_worklist_foreach | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Helper function to set a worklist for one city in the city report. This function is called over all selected rows in the list view.

Definition at line 896 of file cityrep.c.

Referenced by set_worklist_callback(), and set_worklist_callback().

## ◆ toggle_city_hilite()

void toggle_city_hilite | ( | struct city * | pcity,
|  | bool | on_off
| ) |  |

Toggle a city's hilited status.

Definition at line 2089 of file cityrep.c.

Referenced by toggle_tile_hilite().

## ◆ toggle_view()

static void toggle_view | ( | GtkCheckMenuItem * | item,
|  | gpointer | data
| ) |  |

static

User has toggled some column viewing option

Definition at line 1010 of file cityrep.c.

Referenced by create_display_menu(), and update_view_menu().

## ◆ update_total_buy_cost()

static void update_total_buy_cost | ( | void |  | ) |

static

Update the value displayed by the "total buy cost" label in the city report, or make it blank if nothing can be bought.

Definition at line 1959 of file cityrep.c.

Referenced by city_selection_changed_callback(), and real_city_report_update_city().

## ◆ update_view_menu()

static void update_view_menu | ( | GtkWidget * | show_item | ) |

static

Create view menu for city report menubar.

Definition at line 1021 of file cityrep.c.

Referenced by create_city_report_menubar().

## ◆ worklist_first_impr_or_unit_iterate()

static void worklist_first_impr_or_unit_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Called by select_impr_or_unit_callback for each city that is selected in the city list dialog to have a object inserted first to the worklist. Sends a packet adding the current production to the first place after the current production of the worklist. Then changes the production to the requested item.

Definition at line 493 of file cityrep.c.

Referenced by select_impr_or_unit_callback(), and select_impr_or_unit_callback().

## ◆ worklist_last_impr_or_unit_iterate()

static void worklist_last_impr_or_unit_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Called by select_impr_or_unit_callback for each city that is selected in the city list dialog to have a object appended to the worklist. Sends a packet adding the item to the end of the worklist.

Definition at line 472 of file cityrep.c.

Referenced by select_impr_or_unit_callback(), and select_impr_or_unit_callback().

## ◆ worklist_next_impr_or_unit_iterate()

static void worklist_next_impr_or_unit_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Called by select_impr_or_unit_callback for each city that is selected in the city list dialog to have a object added next to the worklist. Sends a packet adding the item to the first place after the current production of the worklist.

Definition at line 513 of file cityrep.c.

Referenced by select_impr_or_unit_callback(), and select_impr_or_unit_callback().

## ◆ worklist_next_to_last_impr_or_unit_iterate()

static void worklist_next_to_last_impr_or_unit_iterate | ( | GtkTreeModel * | model,
|  | GtkTreePath * | path,
|  | GtkTreeIter * | iter,
|  | gpointer | data
| ) |  |

static

Called by select_impr_or_unit_callback for each city that is selected in the city list dialog to have an object added before the last position in the worklist.

Definition at line 532 of file cityrep.c.

Referenced by select_impr_or_unit_callback(), and select_impr_or_unit_callback().

## Variable Documentation

## ◆ change_improvements_item

GtkWidget* change_improvements_item

static

Definition at line 126 of file cityrep.c.

Referenced by create_change_menu(), and popup_change_menu().

## ◆ change_units_item

GtkWidget* change_units_item

static

Definition at line 127 of file cityrep.c.

Referenced by create_change_menu(), and popup_change_menu().

## ◆ change_wonders_item

GtkWidget* change_wonders_item

static

Definition at line 128 of file cityrep.c.

Referenced by create_change_menu(), and popup_change_menu().

## ◆ city_buy_command

GtkWidget* city_buy_command

static

Definition at line 120 of file cityrep.c.

Referenced by city_selection_changed_callback(), and create_city_report_dialog().

## ◆ city_center_command

GtkWidget* city_center_command

static

Definition at line 118 of file cityrep.c.

Referenced by city_selection_changed_callback(), and create_city_report_dialog().

## ◆ city_dialog_shell

struct gui_dialog* city_dialog_shell = NULL

static

Definition at line 98 of file cityrep.c.

Referenced by city_report_dialog_popdown(), city_report_dialog_popup(), create_city_report_dialog(), hilite_cities_from_canvas(), real_city_report_dialog_update(), real_city_report_update_city(), and toggle_city_hilite().

## ◆ city_dialog_shell_is_modal

int city_dialog_shell_is_modal

static

Definition at line 162 of file cityrep.c.

Referenced by city_report_dialog_popup().

## ◆ city_governor_command

GtkWidget* city_governor_command

static

Definition at line 122 of file cityrep.c.

Referenced by city_selection_changed_callback(), create_city_report_menubar(), and real_city_report_dialog_update().

## ◆ city_model

GtkListStore* city_model

static

Definition at line 106 of file cityrep.c.

## ◆ city_popup_command

GtkWidget* city_popup_command

static

Definition at line 119 of file cityrep.c.

Referenced by city_selection_changed_callback(), and create_city_report_dialog().

## ◆ city_production_command

GtkWidget* city_production_command

static

Definition at line 121 of file cityrep.c.

Referenced by city_selection_changed_callback(), and create_city_report_menubar().

## ◆ city_selection

GtkTreeSelection* city_selection

static

Definition at line 105 of file cityrep.c.

Referenced by append_impr_or_unit_to_menu(), append_impr_or_unit_to_menu_item(), append_worklist_callback(), append_worklist_callback(), city_clear_worklist_callback(), city_clear_worklist_callback(), city_command_callback(), city_invert_selection_callback(), city_invert_selection_callback(), city_select_all_callback(), city_select_all_callback(), city_select_building_callback(), city_select_building_callback(), city_select_coastal_callback(), city_select_coastal_callback(), city_select_island_callback(), city_select_same_island_callback(), city_unselect_all_callback(), city_unselect_all_callback(), create_change_menu(), create_city_report_dialog(), hilite_cities_from_canvas(), popup_change_menu(), popup_first_menu(), popup_last_menu(), popup_next_menu(), popup_next_to_last_menu(), popup_select_menu(), real_city_report_dialog_update(), recreate_sell_menu(), recreate_sell_menu(), same_island_iterate(), select_cma_callback(), select_governor_callback(), select_impr_or_unit_callback(), select_impr_or_unit_callback(), set_worklist_callback(), set_worklist_callback(), and toggle_city_hilite().

## ◆ city_sell_command

GtkWidget* city_sell_command

static

Definition at line 123 of file cityrep.c.

Referenced by city_selection_changed_callback(), create_city_report_menubar(), and recreate_sell_menu().

## ◆ city_total_buy_cost_label

GtkWidget* city_total_buy_cost_label

static

Definition at line 124 of file cityrep.c.

Referenced by create_city_report_dialog(), and update_total_buy_cost().

## ◆ city_view

GtkWidget* city_view

static

Definition at line 104 of file cityrep.c.

Referenced by city_report_update_views(), create_city_report_dialog(), and update_total_buy_cost().

## ◆ first_improvements_item

GtkWidget* first_improvements_item

static

Definition at line 134 of file cityrep.c.

Referenced by create_first_menu(), and popup_first_menu().

## ◆ first_units_item

GtkWidget* first_units_item

static

Definition at line 135 of file cityrep.c.

Referenced by create_first_menu(), and popup_first_menu().

## ◆ first_wonders_item

GtkWidget* first_wonders_item

static

Definition at line 136 of file cityrep.c.

Referenced by create_first_menu(), and popup_first_menu().

## ◆ last_improvements_item

GtkWidget* last_improvements_item

static

Definition at line 130 of file cityrep.c.

Referenced by create_last_menu(), and popup_last_menu().

## ◆ last_units_item

GtkWidget* last_units_item

static

Definition at line 131 of file cityrep.c.

Referenced by create_last_menu(), and popup_last_menu().

## ◆ last_wonders_item

GtkWidget* last_wonders_item

static

Definition at line 132 of file cityrep.c.

Referenced by create_last_menu(), and popup_last_menu().

## ◆ next_improvements_item

GtkWidget* next_improvements_item

static

Definition at line 138 of file cityrep.c.

Referenced by create_next_menu(), and popup_next_menu().

## ◆ next_to_last_improvements_item

GtkWidget* next_to_last_improvements_item

static

Definition at line 142 of file cityrep.c.

Referenced by create_next_to_last_menu(), and popup_next_to_last_menu().

## ◆ next_to_last_units_item

GtkWidget* next_to_last_units_item

static

Definition at line 143 of file cityrep.c.

Referenced by create_next_to_last_menu(), and popup_next_to_last_menu().

## ◆ next_to_last_wonders_item

GtkWidget* next_to_last_wonders_item

static

Definition at line 144 of file cityrep.c.

Referenced by create_next_to_last_menu(), and popup_next_to_last_menu().

## ◆ next_units_item

GtkWidget* next_units_item

static

Definition at line 139 of file cityrep.c.

Referenced by create_next_menu(), and popup_next_menu().

## ◆ next_wonders_item

GtkWidget* next_wonders_item

static

Definition at line 140 of file cityrep.c.

Referenced by create_next_menu(), and popup_next_menu().

## ◆ select_bimprovement_item

GtkWidget* select_bimprovement_item

static

Definition at line 149 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_built_improvements_item

GtkWidget* select_built_improvements_item

static

Definition at line 154 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_built_wonders_item

GtkWidget* select_built_wonders_item

static

Definition at line 155 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_bunit_item

GtkWidget* select_bunit_item

static

Definition at line 148 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_bwonder_item

GtkWidget* select_bwonder_item

static

Definition at line 150 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_cma_item

GtkWidget* select_cma_item

static

Definition at line 160 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_improvements_item

GtkWidget* select_improvements_item

static

Definition at line 157 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_island_item

GtkWidget* select_island_item

static

Definition at line 146 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_menu_cached

bool select_menu_cached

Definition at line 164 of file cityrep.c.

Referenced by city_report_dialog_popup(), popup_select_menu(), and real_city_report_dialog_update().

## ◆ select_present_item

GtkWidget* select_present_item

static

Definition at line 153 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_supported_item

GtkWidget* select_supported_item

static

Definition at line 152 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_units_item

GtkWidget* select_units_item

static

Definition at line 158 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().

## ◆ select_wonders_item

GtkWidget* select_wonders_item

static

Definition at line 159 of file cityrep.c.

Referenced by create_select_menu(), and popup_select_menu().