Freeciv-3.3
|
#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 } |
#define CRD_COL_CITY_ID (0 + NUM_CREPORT_COLS) |
|
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().
|
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().
|
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().
|
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().
|
static |
Buy the production in one single city.
Definition at line 1359 of file cityrep.c.
Referenced by city_command_callback().
|
static |
Center to one single city.
Definition at line 1372 of file cityrep.c.
Referenced by city_activated_callback(), and city_command_callback().
|
static |
User has selected city row from city report.
Definition at line 1427 of file cityrep.c.
Referenced by create_city_report_dialog().
|
static |
Returns whether city is building given target
Definition at line 1893 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Called when the "clear worklist" menu item is activated.
Definition at line 2053 of file cityrep.c.
Referenced by create_city_report_menubar(), and create_production_menu().
gui_dialog response callback.
Definition at line 1401 of file cityrep.c.
Referenced by create_city_report_dialog().
|
static |
User has chosen to invert selection
Definition at line 1263 of file cityrep.c.
Referenced by create_select_menu(), and create_select_menu().
|
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().
|
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().
|
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().
|
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().
Closes the city report dialog.
Definition at line 312 of file cityrep.c.
Referenced by exit_city_report_callback(), and popdown_all_game_dialogs().
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(), main_key_down_handler(), report_cities_callback(), report_cities_callback(), and mr_menu::slot_show_cities().
|
static |
Returns a new tree model for the city report.
Definition at line 188 of file cityrep.c.
Referenced by create_city_report_dialog().
Update city report views
Definition at line 986 of file cityrep.c.
Referenced by toggle_view(), and toggle_view().
|
static |
User has chosen to select all cities
Definition at line 1247 of file cityrep.c.
Referenced by create_select_menu(), and create_select_menu().
|
static |
User has chosen to select cities with certain target in production
Definition at line 1332 of file cityrep.c.
Referenced by create_select_menu(), and create_select_menu().
|
static |
User has chosen to select coastal cities
Definition at line 1280 of file cityrep.c.
Referenced by create_select_menu(), and create_select_menu().
|
static |
User has chosen to select all cities on same island
Definition at line 1324 of file cityrep.c.
Referenced by create_select_menu().
|
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 2009 of file cityrep.c.
Referenced by create_city_report_dialog().
|
static |
User has chosen to unselect all cities
Definition at line 1255 of file cityrep.c.
Referenced by create_select_menu(), and create_select_menu().
|
static |
Sort callback.
Definition at line 1123 of file cityrep.c.
Referenced by create_city_report_dialog().
|
static |
Clear the worklist in one selected city in the city report.
Definition at line 2035 of file cityrep.c.
Referenced by city_clear_worklist_callback(), and city_clear_worklist_callback().
|
static |
Create submenu for changing production target
Definition at line 1512 of file cityrep.c.
Referenced by create_city_report_menubar(), and create_production_menu().
Create city report dialog.
Definition at line 1142 of file cityrep.c.
Referenced by city_report_dialog_popup().
Create menubar for city report
Definition at line 1040 of file cityrep.c.
Referenced by create_city_report_dialog().
Creates the first menu.
Definition at line 1550 of file cityrep.c.
Referenced by create_city_report_menubar().
Creates the last menu.
Definition at line 1531 of file cityrep.c.
Referenced by create_city_report_menubar().
Creates the next menu.
Definition at line 1569 of file cityrep.c.
Referenced by create_city_report_menubar().
Append the "next to last" submenu to the given menu item.
Definition at line 1588 of file cityrep.c.
Referenced by create_city_report_menubar().
Creates select menu
Definition at line 1774 of file cityrep.c.
Referenced by create_city_report_menubar(), and recreate_select_menu().
Create the sell menu (empty).
Definition at line 1613 of file cityrep.c.
Referenced by create_city_report_menubar().
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().
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 2070 of file cityrep.c.
Referenced by city_report_dialog_popup(), and define_tiles_within_rectangle().
|
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().
|
static |
Pops up menu where user can select build target.
Definition at line 1624 of file cityrep.c.
Referenced by create_change_menu().
|
static |
Pops up the first menu.
Definition at line 1670 of file cityrep.c.
Referenced by create_first_menu().
|
static |
Popup the dialog of a single city.
Definition at line 1385 of file cityrep.c.
Referenced by city_activated_callback(), and city_command_callback().
|
static |
|
static |
|
static |
Re-create the submenus in the next-to-last production change menu.
Definition at line 1716 of file cityrep.c.
Referenced by create_next_to_last_menu().
|
static |
Popup select menu
Definition at line 1902 of file cityrep.c.
Referenced by create_select_menu(), and create_select_menu().
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().
Update the city report dialog
Definition at line 1458 of file cityrep.c.
Referenced by city_report_dialog_update().
Update the text for a single city in the city report
Definition at line 1493 of file cityrep.c.
Referenced by cities_update_callback().
Update the sell menu.
Definition at line 1747 of file cityrep.c.
Referenced by city_selection_changed_callback(), and create_city_report_dialog().
|
static |
Select all cities on the same continent.
Definition at line 1300 of file cityrep.c.
Referenced by city_select_island_callback(), and city_select_same_island_callback().
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().
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().
|
static |
Iterate the cities going to sell.
Definition at line 548 of file cityrep.c.
Referenced by select_impr_or_unit_callback(), select_impr_or_unit_callback(), and sell_callback_response().
|
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().
|
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 a city's hilited status.
Definition at line 2093 of file cityrep.c.
Referenced by toggle_tile_hilite().
|
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 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 1963 of file cityrep.c.
Referenced by city_selection_changed_callback(), and real_city_report_update_city().
Create view menu for city report menubar.
Definition at line 1021 of file cityrep.c.
Referenced by create_city_report_menubar().
|
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().
|
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().
|
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().
|
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().
|
static |
Definition at line 126 of file cityrep.c.
Referenced by create_change_menu(), and popup_change_menu().
|
static |
Definition at line 127 of file cityrep.c.
Referenced by create_change_menu(), and popup_change_menu().
|
static |
Definition at line 128 of file cityrep.c.
Referenced by create_change_menu(), and popup_change_menu().
|
static |
Definition at line 120 of file cityrep.c.
Referenced by city_selection_changed_callback(), and create_city_report_dialog().
|
static |
Definition at line 118 of file cityrep.c.
Referenced by city_selection_changed_callback(), and create_city_report_dialog().
|
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().
|
static |
Definition at line 162 of file cityrep.c.
Referenced by city_report_dialog_popup().
|
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().
|
static |
|
static |
Definition at line 119 of file cityrep.c.
Referenced by city_selection_changed_callback(), and create_city_report_dialog().
|
static |
Definition at line 121 of file cityrep.c.
Referenced by city_selection_changed_callback(), and create_city_report_menubar().
|
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().
|
static |
Definition at line 123 of file cityrep.c.
Referenced by city_selection_changed_callback(), create_city_report_menubar(), and recreate_sell_menu().
|
static |
Definition at line 124 of file cityrep.c.
Referenced by create_city_report_dialog(), and update_total_buy_cost().
|
static |
Definition at line 104 of file cityrep.c.
Referenced by city_report_update_views(), create_city_report_dialog(), and update_total_buy_cost().
|
static |
Definition at line 134 of file cityrep.c.
Referenced by create_first_menu(), and popup_first_menu().
|
static |
Definition at line 135 of file cityrep.c.
Referenced by create_first_menu(), and popup_first_menu().
|
static |
Definition at line 136 of file cityrep.c.
Referenced by create_first_menu(), and popup_first_menu().
|
static |
Definition at line 130 of file cityrep.c.
Referenced by create_last_menu(), and popup_last_menu().
|
static |
Definition at line 131 of file cityrep.c.
Referenced by create_last_menu(), and popup_last_menu().
|
static |
Definition at line 132 of file cityrep.c.
Referenced by create_last_menu(), and popup_last_menu().
|
static |
Definition at line 138 of file cityrep.c.
Referenced by create_next_menu(), and popup_next_menu().
|
static |
Definition at line 142 of file cityrep.c.
Referenced by create_next_to_last_menu(), and popup_next_to_last_menu().
|
static |
Definition at line 143 of file cityrep.c.
Referenced by create_next_to_last_menu(), and popup_next_to_last_menu().
|
static |
Definition at line 144 of file cityrep.c.
Referenced by create_next_to_last_menu(), and popup_next_to_last_menu().
|
static |
Definition at line 139 of file cityrep.c.
Referenced by create_next_menu(), and popup_next_menu().
|
static |
Definition at line 140 of file cityrep.c.
Referenced by create_next_menu(), and popup_next_menu().
|
static |
Definition at line 149 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Definition at line 154 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Definition at line 155 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Definition at line 148 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Definition at line 150 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Definition at line 160 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Definition at line 157 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Definition at line 146 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
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().
|
static |
Definition at line 153 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Definition at line 152 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Definition at line 158 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().
|
static |
Definition at line 159 of file cityrep.c.
Referenced by create_select_menu(), and popup_select_menu().